diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-05 19:43:02 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-05 19:43:03 +0100 |
commit | 4a2e91db652e197803c6f29e2c2f1c9dfbc16506 (patch) | |
tree | abae7a1c8eb6eeb0d57f561725122341c3e07fe7 /t/t5516-fetch-push.sh | |
parent | Merge branch 'es/worktree-avoid-duplication-fix' (diff) | |
parent | t2402: test worktree path when called in .git directory (diff) | |
download | git-4a2e91db652e197803c6f29e2c2f1c9dfbc16506.tar.xz git-4a2e91db652e197803c6f29e2c2f1c9dfbc16506.zip |
Merge branch 'hv/receive-denycurrent-everywhere'
"git push" should stop from updating a branch that is checked out
when receive.denyCurrentBranch configuration is set, but it failed
to pay attention to checkouts in secondary worktrees. This has
been corrected.
* hv/receive-denycurrent-everywhere:
t2402: test worktree path when called in .git directory
receive.denyCurrentBranch: respect all worktrees
t5509: use a bare repository for test push target
get_main_worktree(): allow it to be called in the Git directory
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-x | t/t5516-fetch-push.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index f12cbef097..9ff041a093 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1712,4 +1712,15 @@ test_expect_success 'updateInstead with push-to-checkout hook' ' ) ' +test_expect_success 'denyCurrentBranch and worktrees' ' + git worktree add new-wt && + git clone . cloned && + test_commit -C cloned first && + test_config receive.denyCurrentBranch refuse && + test_must_fail git -C cloned push origin HEAD:new-wt && + test_config receive.denyCurrentBranch updateInstead && + git -C cloned push origin HEAD:new-wt && + test_must_fail git -C cloned push --delete origin new-wt +' + test_done |