Permalink
Browse files

Use quotes to avoid unary operator error.

  • Loading branch information...
1 parent 9c43e65 commit 6e29ef2bc1386c9116d32f25aecccb55ab7971e6 @stephenh committed Nov 12, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/pull
View
@@ -5,15 +5,15 @@ if [[ $? -ne 0 ]] ; then
echo "Not on a branch"
exit 1
fi
-
branch_name=${branch_name/refs\/heads\//}
git fetch
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"

0 comments on commit 6e29ef2

Please sign in to comment.