From 6e29ef2bc1386c9116d32f25aecccb55ab7971e6 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Tue, 11 Nov 2008 23:04:59 -0600 Subject: [PATCH] Use quotes to avoid unary operator error. --- scripts/pull | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pull b/scripts/pull index f2b149b..64de460 100644 --- a/scripts/pull +++ b/scripts/pull @@ -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" -- 2.39.5