diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-21 22:57:51 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-21 22:57:51 +0900 |
commit | 7d483e9c00516413a9c2dafc24a6ecb40975b02b (patch) | |
tree | 54b57d8716409d4bbbd440a7dbe9e305d67bcdf0 /t/t5516-fetch-push.sh | |
parent | Merge branch 'js/diff-notice-has-drive-prefix' into maint (diff) | |
parent | receive: denyCurrentBranch=updateinstead should not blindly update (diff) | |
download | tgif-7d483e9c00516413a9c2dafc24a6ecb40975b02b.tar.xz |
Merge branch 'jc/receive-deny-current-branch-fix' into maint
The receive.denyCurrentBranch=updateInstead codepath kicked in even
when the push should have been rejected due to other reasons, such
as it does not fast-forward or the update-hook rejects it, which
has been corrected.
* jc/receive-deny-current-branch-fix:
receive: denyCurrentBranch=updateinstead should not blindly update
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-x | t/t5516-fetch-push.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 539c25aada..bb0a36535c 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1552,7 +1552,13 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' ' test $(git -C .. rev-parse master) = $(git rev-parse HEAD) && git diff --quiet && git diff --cached --quiet - ) + ) && + + # (6) updateInstead intervened by fast-forward check + test_must_fail git push void master^:master && + test $(git -C void rev-parse HEAD) = $(git rev-parse master) && + git -C void diff --quiet && + git -C void diff --cached --quiet ' test_expect_success 'updateInstead with push-to-checkout hook' ' |