summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:38 (GMT)
commit2fb11ec6c175e8a380d91daccc3bbf9fc5bbea8b (patch)
tree1f6c6ed0942f20d97705b9e3e4dd603d122fafa8 /t
parent101f3dc92a4cedb1f359f6ddce913b631ffa75b6 (diff)
parent33b842a1e9bf28bcffe953ad9dcdbb0561336314 (diff)
downloadgit-2fb11ec6c175e8a380d91daccc3bbf9fc5bbea8b.zip
git-2fb11ec6c175e8a380d91daccc3bbf9fc5bbea8b.tar.gz
git-2fb11ec6c175e8a380d91daccc3bbf9fc5bbea8b.tar.bz2
Merge branch 'jc/pull-rebase-ff'
"git pull --rebase", when there is no new commits on our side since we forked from the upstream, should be able to fast-forward without invoking "git rebase", but it didn't. * jc/pull-rebase-ff: pull: fast-forward "pull --rebase=true"
Diffstat (limited to 't')
-rwxr-xr-xt/t5520-pull.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 5518445..17f4d0f 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -255,6 +255,23 @@ test_expect_success '--rebase' '
test new = "$(git show HEAD:file2)"
'
+test_expect_success '--rebase fast forward' '
+ git reset --hard before-rebase &&
+ git checkout -b ff &&
+ echo another modification >file &&
+ git commit -m third file &&
+
+ git checkout to-rebase &&
+ git pull --rebase . ff &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse ff)" &&
+
+ # The above only validates the result. Did we actually bypass rebase?
+ git reflog -1 >reflog.actual &&
+ sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
+ echo "OBJID HEAD@{0}: pull --rebase . ff: Fast-forward" >reflog.expected &&
+ test_cmp reflog.expected reflog.fuzzy
+'
+
test_expect_success '--rebase with conflicts shows advice' '
test_when_finished "git rebase --abort; git checkout -f to-rebase" &&
git checkout -b seq &&