]> git.droids-corp.org - git-central.git/commitdiff
Use quotes to avoid unary operator error.
authorStephen Haberman <stephen@exigencecorp.com>
Wed, 12 Nov 2008 05:04:59 +0000 (23:04 -0600)
committerStephen Haberman <stephen@exigencecorp.com>
Wed, 12 Nov 2008 05:04:59 +0000 (23:04 -0600)
scripts/pull

index f2b149bddb32192faa88919d5be19fb453e16d49..64de460a9fdca06c966abbeba3e83984736bf102 100644 (file)
@@ -5,7 +5,6 @@ if [[ $? -ne 0 ]] ; then
        echo "Not on a branch"
        exit 1
 fi
-
 branch_name=${branch_name/refs\/heads\//}
 
 git fetch
@@ -13,7 +12,8 @@ if [[ $? -ne 0 ]] ; then
        exit $?
 fi
 
-if test $(git rev-parse HEAD) = $(git merge-base HEAD origin/$branch_name) ; then
+# rebase-p-i stops if nothing to do, even a ff, so do a non-i-p if needed
+if test "$(git rev-parse HEAD)" = "$(git merge-base HEAD origin/$branch_name)" ; then
        git rebase "origin/$branch_name"
 else
        GIT_EDITOR=: git rebase -p -i "origin/$branch_name"