summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <Johannes.Schindelin@gmx.de>2006-09-21 02:10:30 +0200
committerLibravatar Junio C Hamano <junkio@cox.net>2006-09-20 23:32:22 -0700
commit199a92186b6721b23a2400c91f8bd44e7ffa349a (patch)
tree15c92873f4ef6ebd9eaf33463a76331f3076094d /t
parentreceive-pack: plug memory leak in fast-forward checking code. (diff)
downloadtgif-199a92186b6721b23a2400c91f8bd44e7ffa349a.tar.xz
Document receive.denyNonFastforwards
[jc: with a fix to config handling in t5400 test, which took annoyingly long to diagnose.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t5400-send-pack.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index f3694ac3c7..8afb899717 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -64,4 +64,18 @@ test_expect_success \
cmp victim/.git/refs/heads/master .git/refs/heads/master
'
+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_success \
+ 'pushing with --force should be denied with denyNonFastforwards' '
+ cd victim &&
+ git-repo-config receive.denyNonFastforwards true &&
+ cd .. &&
+ git-update-ref refs/heads/master master^ &&
+ git-send-pack --force ./victim/.git/ master &&
+ ! diff -u .git/refs/heads/master victim/.git/refs/heads/master
+'
+
test_done