unwritable tests: assert exact error output
commit119b26d6b9a98fd22bbd340da39cf15d4712fb97
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 12 Oct 2021 14:30:48 +0000 (12 16:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Oct 2021 18:16:42 +0000 (12 11:16 -0700)
tree27eff92dbfd9010fe0dee80ae2aa0c34928c8e44
parent225bc32a989d7a22fa6addafd4ce7dcd04675dbf
unwritable tests: assert exact error output

In preparation for fixing a regression where we started emitting some
of these error messages twice, let's assert what the output from "git
commit" and friends is now in the case of permission errors.

As noted in [1] using test_expect_failure to mark up a TODO test has
some unexpected edge cases, e.g. we don't want to break --run=3 by
skipping the "test_lazy_prereq" here. This pattern allows us to test
just the test_cmp (and the "cat", which shouldn't fail) with the added
"test_expect_failure", we'll flip that to a "test_expect_success" in
the next commit.

1. https://lore.kernel.org/git/87tuhmk19c.fsf@evledraar.gmail.com/T/#u

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0004-unwritable.sh