fetch tests: double quote a variable for interpolation
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 9 Feb 2018 20:32:08 +0000 (20:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2018 21:10:12 +0000 (13:10 -0800)
If the $cmdline variable contains arguments with spaces they won't be
interpolated correctly, since the body of the test is single quoted,
and because test-lib.sh does its own eval().

This will be used in a subsequent commit to pass arguments that need
to be quoted to git-fetch, i.e. a file:// path to fetch, which will
have a space in it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5510-fetch.sh
index dacdb8759c9046a669d0ad4cf999caea12108e7e..88d38e0819111b3b0836d37bd39fd96c946a154b 100755 (executable)
@@ -578,7 +578,7 @@ test_configured_prune () {
                        set_config_tristate fetch.prune $fetch_prune &&
                        set_config_tristate remote.origin.prune $remote_origin_prune &&
 
-                       git fetch $cmdline &&
+                       git fetch '"$cmdline"' &&
                        case "$expected_branch" in
                        pruned)
                                test_must_fail git rev-parse --verify refs/remotes/origin/newbranch