fix: fetch upstream before comparing (#61)

This commit is contained in:
openoms 2020-06-06 12:21:31 +01:00 committed by GitHub
parent 92cadf5a6d
commit 358dc3760a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
# fetch latest master
echo "Checking for changes upstream ..."
git fetch
UPSTREAM=${1:-'@{u}'} UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @) LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM") REMOTE=$(git rev-parse "$UPSTREAM")
@ -8,9 +10,7 @@ if [ $LOCAL = $REMOTE ]; then
TAG=$(git tag | sort -V | tail -1) TAG=$(git tag | sort -V | tail -1)
echo "You are up-to-date on version" $TAG echo "You are up-to-date on version" $TAG
else else
# fetch latest master
echo "Pulling latest changes..." echo "Pulling latest changes..."
git fetch
git pull -p git pull -p
# install deps # install deps