summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-02-18 13:53:27 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-18 13:53:27 -0800
commit867b520301cc5e719b575edde7736ebe70a19298 (patch)
tree518a7677382c18be1913971a955311babd9dfe9d /t
parentThe fifth batch (diff)
parentreceive-pack: purge temporary data if no command is ready to run (diff)
downloadtgif-867b520301cc5e719b575edde7736ebe70a19298.tar.xz
Merge branch 'cb/clear-quarantine-early-on-all-ref-update-errors'
"receive-pack" checks if it will do any ref updates (various conditions could reject a push) before received objects are taken out of the temporary directory used for quarantine purposes, so that a push that is known-to-fail will not leave crufts that a future "gc" needs to clean up. * cb/clear-quarantine-early-on-all-ref-update-errors: receive-pack: purge temporary data if no command is ready to run
Diffstat (limited to 't')
-rwxr-xr-xt/t5516-fetch-push.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 87881726ed..3137eb8d4d 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1821,4 +1821,12 @@ test_expect_success 'refuse fetch to current branch of bare repository worktree'
git -C bare.git fetch -u .. HEAD:wt
'
+test_expect_success 'refuse to push a hidden ref, and make sure do not pollute the repository' '
+ mk_empty testrepo &&
+ git -C testrepo config receive.hiderefs refs/hidden &&
+ git -C testrepo config receive.unpackLimit 1 &&
+ test_must_fail git push testrepo HEAD:refs/hidden/foo &&
+ test_dir_is_empty testrepo/.git/objects/pack
+'
+
test_done