From 199a92186b6721b23a2400c91f8bd44e7ffa349a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 21 Sep 2006 02:10:30 +0200 Subject: Document receive.denyNonFastforwards [jc: with a fix to config handling in t5400 test, which took annoyingly long to diagnose.] Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t5400-send-pack.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't/t5400-send-pack.sh') 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 -- cgit v1.2.1