From a240de1137bd63a969c6bd56ab5186d7216e28ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kr=C3=BCger?= Date: Sat, 1 Nov 2008 15:42:16 +0100 Subject: Introduce receive.denyDeletes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Occasionally, it may be useful to prevent branches from getting deleted from a centralized repository, particularly when no administrative access to the server is available to undo it via reflog. It also makes receive.denyNonFastForwards more useful if it is used for access control since it prevents force-updating by deleting and re-creating a ref. Signed-off-by: Jan Krüger Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- t/t5400-send-pack.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't/t5400-send-pack.sh') diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 544771d8fa..6fe2f87b85 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -103,6 +103,17 @@ unset GIT_CONFIG GIT_CONFIG_LOCAL HOME=`pwd`/no-such-directory export HOME ;# this way we force the victim/.git/config to be used. +test_expect_failure \ + 'pushing a delete should be denied with denyDeletes' ' + cd victim && + git config receive.denyDeletes true && + git branch extra master && + cd .. && + test -f victim/.git/refs/heads/extra && + test_must_fail git send-pack ./victim/.git/ :extra master +' +rm -f victim/.git/refs/heads/extra + test_expect_success \ 'pushing with --force should be denied with denyNonFastforwards' ' cd victim && -- cgit v1.2.3