diff --git a/startup.sh b/startup.sh index 1194ca1..2bacebb 100755 --- a/startup.sh +++ b/startup.sh @@ -6,10 +6,7 @@ SCRIPTPATH=$(dirname "$SCRIPT") SCRIPTNAME="$0" ARGS="$@" -UPSTREAM=${1:-'@{u}'} -LOCAL=$(git rev-parse @) #Hash of the current local commit (@ is a git shorthand) -REMOTE=$(git rev-parse "$UPSTREAM") #Hash of the current upstream commit -BASE=$(git merge-base @ "$UPSTREAM") #Hash of the commit at which the current branch and its upstream diverge + self_update() { @@ -18,6 +15,11 @@ self_update() { cd $SCRIPTPATH git fetch + + UPSTREAM=${1:-'@{u}'} + LOCAL=$(git rev-parse @) #Hash of the current local commit (@ is a git shorthand) + REMOTE=$(git rev-parse "$UPSTREAM") #Hash of the current upstream commit + BASE=$(git merge-base @ "$UPSTREAM") #Hash of the commit at which the current branch and its upstream diverge if [ $LOCAL = $REMOTE ]; then echo "Repo is Up-to-date"