summaryrefslogtreecommitdiff
path: root/t/t5400-send-pack.sh
diff options
context:
space:
mode:
authorJan Krüger <jk@jk.gs>2008-11-01 14:42:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-02 08:54:28 (GMT)
commita240de1137bd63a969c6bd56ab5186d7216e28ca (patch)
tree6a876638cfc09ee414599b0d4dae46eca7b10105 /t/t5400-send-pack.sh
parentaebd173ffa7a4e67447f0157a14abde7767c54e9 (diff)
downloadgit-a240de1137bd63a969c6bd56ab5186d7216e28ca.zip
git-a240de1137bd63a969c6bd56ab5186d7216e28ca.tar.gz
git-a240de1137bd63a969c6bd56ab5186d7216e28ca.tar.bz2
Introduce receive.denyDeletes
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 <jk@jk.gs> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5400-send-pack.sh')
-rwxr-xr-xt/t5400-send-pack.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 544771d..6fe2f87 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 &&