From: Michael J Gruber Date: Fri, 4 Mar 2016 10:53:50 +0000 (+0100) Subject: t5510: do not leave changed cwd X-Git-Tag: v2.8.0-rc2~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=816c19308b39d0f9f6d15e8320aa1d2ab148e3d2;p=thirdparty%2Fgit.git t5510: do not leave changed cwd t5510 carefully keeps the cwd at the test root by using either subshells or explicit cd'ing back to the root. Use a subshell for the last subtest, too. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index e3ee4bd700..5b52c877c3 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -715,10 +715,12 @@ test_expect_success 'fetching with auto-gc does not lock up' ' EOF git clone "file://$D" auto-gc && test_commit test2 && - cd auto-gc && - git config gc.autoPackLimit 1 && - GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 && - ! grep "Should I try again" fetch.out + ( + cd auto-gc && + git config gc.autoPackLimit 1 && + GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 && + ! grep "Should I try again" fetch.out + ) ' test_done