Fixed error in logic: commit hashes must be set after fetch, not before.
This commit is contained in:
parent
7f7dc3f802
commit
641a339c48
1 changed files with 6 additions and 4 deletions
10
startup.sh
10
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"
|
||||
|
|
Loading…
Reference in a new issue