diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-05 10:43:02 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-05 10:43:03 -0800 |
commit | 4a2e91db652e197803c6f29e2c2f1c9dfbc16506 (patch) | |
tree | abae7a1c8eb6eeb0d57f561725122341c3e07fe7 /t/t5509-fetch-push-namespaces.sh | |
parent | Merge branch 'es/worktree-avoid-duplication-fix' (diff) | |
parent | t2402: test worktree path when called in .git directory (diff) | |
download | tgif-4a2e91db652e197803c6f29e2c2f1c9dfbc16506.tar.xz |
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/t5509-fetch-push-namespaces.sh')
-rwxr-xr-x | t/t5509-fetch-push-namespaces.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh index 75cbfcc392..a67f792adf 100755 --- a/t/t5509-fetch-push-namespaces.sh +++ b/t/t5509-fetch-push-namespaces.sh @@ -20,7 +20,7 @@ test_expect_success setup ' ) && commit0=$(cd original && git rev-parse HEAD^) && commit1=$(cd original && git rev-parse HEAD) && - git init pushee && + git init --bare pushee && git init puller ' @@ -152,4 +152,15 @@ test_expect_success 'clone chooses correct HEAD (v2)' ' test_cmp expect actual ' +test_expect_success 'denyCurrentBranch and unborn branch with ref namespace' ' + ( + cd original && + git init unborn && + git remote add unborn-namespaced "ext::git --namespace=namespace %s unborn" && + test_must_fail git push unborn-namespaced HEAD:master && + git -C unborn config receive.denyCurrentBranch updateInstead && + git push unborn-namespaced HEAD:master + ) +' + test_done |