diff mbox series

[07/10] fetch tests: remove lazy variable setup

Message ID patch-07.10-267a6a6ab8f-20220621T222854Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series t5510: fix the quoting mess | expand

Commit Message

Ævar Arnfjörð Bjarmason June 21, 2022, 10:34 p.m. UTC
Remove the lazy test setup added in e1790f9245f (fetch tests: fetch
<url> <spec> as well as fetch [<remote>], 2018-02-09) to make it clear
that these variables aren't changing across runs.

We can also do away with the shell invocations here, but let's do that
in a subsequent commit, for now this shows that it's safe to do this
more than once.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t5510-fetch.sh | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index c56a00f1a17..7cfef0082c0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -846,14 +846,9 @@  test_configured_prune_type () {
 	shift 6 &&
 	local cmdline="$@" &&
 
-	if test -z "$cmdline_setup"
-	then
-		test_expect_success 'setup cmdline_setup variable for subsequent test' '
-			remote_url="file://$(git -C one config remote.origin.url)" &&
-			remote_fetch="$(git -C one config remote.origin.fetch)" &&
-			cmdline_setup="\"$remote_url\" \"$remote_fetch\""
-		'
-	fi &&
+	remote_url="file://$(git -C one config remote.origin.url)" &&
+	remote_fetch="$(git -C one config remote.origin.fetch)" &&
+	cmdline_setup="\"$remote_url\" \"$remote_fetch\"" &&
 
 	if test "$mode" = 'link'
 	then