summaryrefslogtreecommitdiff
path: root/t/t5509-fetch-push-namespaces.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-05 18:43:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-05 18:43:03 (GMT)
commit4a2e91db652e197803c6f29e2c2f1c9dfbc16506 (patch)
treeabae7a1c8eb6eeb0d57f561725122341c3e07fe7 /t/t5509-fetch-push-namespaces.sh
parent49e5043b09fffb0411e8bae19d60014e72a36fd0 (diff)
parent4d864895a23bbbb5403d9aa8a65d0576d2029597 (diff)
downloadgit-4a2e91db652e197803c6f29e2c2f1c9dfbc16506.zip
git-4a2e91db652e197803c6f29e2c2f1c9dfbc16506.tar.gz
git-4a2e91db652e197803c6f29e2c2f1c9dfbc16506.tar.bz2
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-xt/t5509-fetch-push-namespaces.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh
index 75cbfcc..a67f792 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