diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-10-30 09:43:46 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-30 09:43:46 +0300 |
commit | 4c7f5440225aba8f0c7253575e5ffa933a267de7 (patch) | |
tree | 498a09bea3303497ac2c101b79371538b188aeae /t/t5516-fetch-push.sh | |
parent | 5742ba504c04420446556a389e5b99e6b228d928 (diff) | |
parent | b072a25fad21b8aecfa29f6ffb813a0a6194a764 (diff) |
Merge branch 'jc/receive-deny-current-branch-fix'
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 7a8f56db53..7316365a24 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1577,7 +1577,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' ' |