git-svn: support for git-svn propset
[gitweb.git] / t / t5401-update-hooks.sh
index 7240fabfec9462ab5efee3a0d21386f306a29a9d..7f278d8ce932f34420c337571ec043ffb5e318e9 100755 (executable)
@@ -124,6 +124,7 @@ remote: STDOUT update refs/heads/master
 remote: STDERR update refs/heads/master
 remote: STDOUT update refs/heads/tofail
 remote: STDERR update refs/heads/tofail
+remote: error: hook declined to update refs/heads/tofail
 remote: STDOUT post-receive
 remote: STDERR post-receive
 remote: STDOUT post-update
@@ -131,7 +132,20 @@ remote: STDERR post-update
 EOF
 test_expect_success 'send-pack stderr contains hook messages' '
        grep ^remote: send.err | sed "s/ *\$//" >actual &&
-       test_cmp - actual <expect
+       test_cmp expect actual
+'
+
+test_expect_success 'pre-receive hook that forgets to read its input' '
+       write_script victim.git/hooks/pre-receive <<-\EOF &&
+       exit 0
+       EOF
+       rm -f victim.git/hooks/update victim.git/hooks/post-update &&
+
+       for v in $(test_seq 100 999)
+       do
+               git branch branch_$v master || return
+       done &&
+       git push ./victim.git "+refs/heads/*:refs/heads/*"
 '
 
 test_done