exit $?
fi
-GIT_EDITOR=: git rebase -p -i "origin/$branch_name"
+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"
+fi
# Merge stable locally too--should conflict
git checkout topic2 &&
pull &&
- test 1 = $(git rev-list --all --pretty=oneline | grep "replayed" | wc -l)
+ test 1 = $(git rev-list --all --pretty=oneline | grep "replayed" | wc -l) &&
+ push
+'
+
+test_expect_success 'pull moves when we have no local changes' '
+ git checkout topic2 &&
+
+ # Move topic2 on the server
+ cd server &&
+ git checkout topic2 &&
+ echo "$test_name" > a.topic2.server &&
+ git commit -a -m "move topic2 on the server" &&
+ cd .. &&
+
+ pull &&
+ test $(git rev-parse HEAD) = $(git rev-parse origin/topic2)
'
test_done