]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5516-fetch-push.sh
Merge branch 'hv/receive-denycurrent-everywhere'
[thirdparty/git.git] / t / t5516-fetch-push.sh
index f12cbef09728d9c49b0ad66eab77c57043df0596..9ff041a093e71aac932f5e563d4922930bc62ff2 100755 (executable)
@@ -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