diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-17 15:11:04 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-17 15:11:05 -0800 |
commit | e4ec4089883c9076744561863f9913bdefec06cf (patch) | |
tree | 0da60edb46ca721baef5a128e3450cb6466d5f53 /t | |
parent | Merge branch 'js/normalize-path-copy-ceil' into maint (diff) | |
parent | pull: fast-forward "pull --rebase=true" (diff) | |
download | tgif-e4ec4089883c9076744561863f9913bdefec06cf.tar.xz |
Merge branch 'jc/pull-rebase-ff' into maint
"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-x | t/t5520-pull.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 551844584f..17f4d0fe4e 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 && |