t/t5571-prep-push-hook.sh: Add test with writing to stderr

The 2.53.0.rc0.windows release candidate had a regression where
writing to stderr from a pre-push hook would error out.

The regression was fixed in 2.53.0.rc1.windows and the test here ensures
that this stays fixed.

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
This commit is contained in:
Thomas Braun 2026-01-26 19:02:44 +01:00 committed by Johannes Schindelin
parent 39792672e5
commit 541d54bc01

View File

@ -138,4 +138,16 @@ test_expect_success 'sigpipe does not cause pre-push hook failure' '
git push parent1 "refs/heads/b/*:refs/heads/b/*"
'
test_expect_success 'can write to stderr' '
test_hook --clobber pre-push <<-\EOF &&
echo foo >/dev/stderr &&
exit 0
EOF
test_commit third &&
echo foo >expect &&
git push --quiet parent1 HEAD 2>actual &&
test_cmp expect actual
'
test_done