summaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-30 06:43:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-30 06:43:46 (GMT)
commit4c7f5440225aba8f0c7253575e5ffa933a267de7 (patch)
tree498a09bea3303497ac2c101b79371538b188aeae /t/t5516-fetch-push.sh
parent5742ba504c04420446556a389e5b99e6b228d928 (diff)
parentb072a25fad21b8aecfa29f6ffb813a0a6194a764 (diff)
downloadgit-4c7f5440225aba8f0c7253575e5ffa933a267de7.zip
git-4c7f5440225aba8f0c7253575e5ffa933a267de7.tar.gz
git-4c7f5440225aba8f0c7253575e5ffa933a267de7.tar.bz2
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-xt/t5516-fetch-push.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 7a8f56d..7316365 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' '