]> git.ipfire.org Git - thirdparty/git.git/commit
t5510: prefer "git -C" to subshell for followRemoteHEAD tests
authorJeff King <peff@peff.net>
Tue, 19 Aug 2025 19:27:16 +0000 (15:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Aug 2025 23:06:02 +0000 (16:06 -0700)
commitf1c2a42eacd272f7aa28ea8d017ae84547ee9ab1
treeac19016ba19fe8728bc2f320e2933b34117d5876
parent1de2903c0f065b4c14326a741a57cc7e7b63610f
t5510: prefer "git -C" to subshell for followRemoteHEAD tests

These tests set config within a sub-repo using (cd two && git config),
and then a separate test_when_finished outside the subshell to clean it
up. We can't use test_config to do this, because the cleanup command it
registers inside the subshell would be lost. Nor can we do it before
entering the subshell, because the config has to be set after some other
commands are run.

Let's switch these tests to use "git -C" for each command instead of a
subshell. That lets us use test_config (with -C also) at the appropriate
part of the test. And we no longer need the manual cleanup command.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5510-fetch.sh