t5526: stop asserting on stderr literally
commit6e94bd64f334b91fab0f06b44ad00fc34a068a8c
authorGlen Choo <chooglen@google.com>
Tue, 8 Mar 2022 00:14:25 +0000 (7 16:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Mar 2022 00:51:03 +0000 (7 16:51 -0800)
treed3dfeac5feaecb026e050e2c03886952f2fa4a99
parentf3117dfdd1a0e586066bb8963b43324f5dee9f90
t5526: stop asserting on stderr literally

In the previous commit message, we noted that not all of the "git fetch"
stderr is relevant to the tests. Most of the test setup lines are
dedicated to these details of the stderr:

1. which repos (super/sub/deep) are involved in the fetch
2. the head of the remote-tracking branch before the fetch (i.e. $head1)
3. the head of the remote-tracking branch after the fetch (i.e. $head2)

1. and 3. are relevant because they tell us that the expected commit is
fetched by the expected repo, but 2. is completely irrelevant.

Stop asserting on $head1 by replacing it with a dummy value in the
actual and expected output. Do this by introducing test
helpers (write_expected_*()) that make it easier to construct the
expected output, and use sed to munge the actual output.

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5526-fetch-submodules.sh