diff mbox series

[06/10] fetch tests: pass a list, not a string of arguments

Message ID patch-06.10-65c35361f88-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
Follow-up on the preceding commit where we've started to intercept
these arguments as "$@" and pass them as a list, not as a string,
before we'd only have a "$@" equivalent to "$1".

We're still not doing anything really useful with these, but this is
getting us towards fixing the quote handling in
"test_configured_prune_type()".

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

Patch

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 477b6dd4953..c56a00f1a17 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -940,82 +940,82 @@  test_configured_prune () {
 # $4 config: remote.<name>.pruneTags
 # $5 expect: branch to be pruned?
 # $6 expect: tag to be pruned?
-# $7 git-fetch $cmdline:
+# $7... git-fetch $cmdline:
 #
-#                     $1    $2    $3    $4    $5     $6     $7
-test_configured_prune unset unset unset unset kept   kept   ""
-test_configured_prune unset unset unset unset kept   kept   "--no-prune"
-test_configured_prune unset unset unset unset pruned kept   "--prune"
+#                     $1    $2    $3    $4    $5     $6     $7...
+test_configured_prune unset unset unset unset kept   kept
+test_configured_prune unset unset unset unset kept   kept   --no-prune
+test_configured_prune unset unset unset unset pruned kept   --prune
 test_configured_prune unset unset unset unset kept   pruned \
-	"--prune origin refs/tags/*:refs/tags/*"
+	--prune origin "refs/tags/*:refs/tags/*"
 test_configured_prune unset unset unset unset pruned pruned \
-	"--prune origin refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*"
+	--prune origin "refs/tags/*:refs/tags/*" "+refs/heads/*:refs/remotes/origin/*"
 
-test_configured_prune false unset unset unset kept   kept   ""
-test_configured_prune false unset unset unset kept   kept   "--no-prune"
-test_configured_prune false unset unset unset pruned kept   "--prune"
+test_configured_prune false unset unset unset kept   kept
+test_configured_prune false unset unset unset kept   kept   --no-prune
+test_configured_prune false unset unset unset pruned kept   --prune
 
-test_configured_prune true  unset unset unset pruned kept   ""
-test_configured_prune true  unset unset unset pruned kept   "--prune"
-test_configured_prune true  unset unset unset kept   kept   "--no-prune"
+test_configured_prune true  unset unset unset pruned kept
+test_configured_prune true  unset unset unset pruned kept   --prune
+test_configured_prune true  unset unset unset kept   kept   --no-prune
 
-test_configured_prune unset false unset unset kept   kept   ""
-test_configured_prune unset false unset unset kept   kept   "--no-prune"
-test_configured_prune unset false unset unset pruned kept   "--prune"
+test_configured_prune unset false unset unset kept   kept
+test_configured_prune unset false unset unset kept   kept   --no-prune
+test_configured_prune unset false unset unset pruned kept   --prune
 
-test_configured_prune false false unset unset kept   kept   ""
-test_configured_prune false false unset unset kept   kept   "--no-prune"
-test_configured_prune false false unset unset pruned kept   "--prune"
+test_configured_prune false false unset unset kept   kept
+test_configured_prune false false unset unset kept   kept   --no-prune
+test_configured_prune false false unset unset pruned kept   --prune
 test_configured_prune false false unset unset kept   pruned \
-	"--prune origin refs/tags/*:refs/tags/*"
+	--prune origin "refs/tags/*:refs/tags/*"
 test_configured_prune false false unset unset pruned pruned \
-	"--prune origin refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*"
+	--prune origin "refs/tags/*:refs/tags/*" "+refs/heads/*:refs/remotes/origin/*"
 
-test_configured_prune true  false unset unset kept   kept   ""
-test_configured_prune true  false unset unset pruned kept   "--prune"
-test_configured_prune true  false unset unset kept   kept   "--no-prune"
+test_configured_prune true  false unset unset kept   kept
+test_configured_prune true  false unset unset pruned kept   --prune
+test_configured_prune true  false unset unset kept   kept   --no-prune
 
-test_configured_prune unset true  unset unset pruned kept   ""
-test_configured_prune unset true  unset unset kept   kept   "--no-prune"
-test_configured_prune unset true  unset unset pruned kept   "--prune"
+test_configured_prune unset true  unset unset pruned kept
+test_configured_prune unset true  unset unset kept   kept   --no-prune
+test_configured_prune unset true  unset unset pruned kept   --prune
 
-test_configured_prune false true  unset unset pruned kept   ""
-test_configured_prune false true  unset unset kept   kept   "--no-prune"
-test_configured_prune false true  unset unset pruned kept   "--prune"
+test_configured_prune false true  unset unset pruned kept
+test_configured_prune false true  unset unset kept   kept   --no-prune
+test_configured_prune false true  unset unset pruned kept   --prune
 
-test_configured_prune true  true  unset unset pruned kept   ""
-test_configured_prune true  true  unset unset pruned kept   "--prune"
-test_configured_prune true  true  unset unset kept   kept   "--no-prune"
+test_configured_prune true  true  unset unset pruned kept
+test_configured_prune true  true  unset unset pruned kept   --prune
+test_configured_prune true  true  unset unset kept   kept   --no-prune
 test_configured_prune true  true  unset unset kept   pruned \
-	"--prune origin refs/tags/*:refs/tags/*"
+	--prune origin "refs/tags/*:refs/tags/*"
 test_configured_prune true  true  unset unset pruned pruned \
-	"--prune origin refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*"
+	--prune origin "refs/tags/*:refs/tags/*" "+refs/heads/*:refs/remotes/origin/*"
 
 # --prune-tags on its own does nothing, needs --prune as well, same
 # for fetch.pruneTags without fetch.prune
-test_configured_prune unset unset unset unset kept kept     "--prune-tags"
-test_configured_prune unset unset true unset  kept kept     ""
-test_configured_prune unset unset unset true  kept kept     ""
+test_configured_prune unset unset unset unset kept kept     --prune-tags
+test_configured_prune unset unset true unset  kept kept
+test_configured_prune unset unset unset true  kept kept
 
 # These will prune the tags
-test_configured_prune unset unset unset unset pruned pruned "--prune --prune-tags"
-test_configured_prune true  unset true  unset pruned pruned ""
-test_configured_prune unset true  unset true  pruned pruned ""
+test_configured_prune unset unset unset unset pruned pruned --prune --prune-tags
+test_configured_prune true  unset true  unset pruned pruned
+test_configured_prune unset true  unset true  pruned pruned
 
 # remote.<name>.pruneTags overrides fetch.pruneTags, just like
 # remote.<name>.prune overrides fetch.prune if set.
-test_configured_prune true  unset true unset pruned pruned  ""
-test_configured_prune false true  false true  pruned pruned ""
-test_configured_prune true  false true  false kept   kept   ""
+test_configured_prune true  unset true unset pruned pruned
+test_configured_prune false true  false true  pruned pruned
+test_configured_prune true  false true  false kept   kept
 
 # When --prune-tags is supplied it's ignored if an explicit refspec is
 # given, same for the configuration options.
 test_configured_prune unset unset unset unset pruned kept \
-	"--prune --prune-tags origin +refs/heads/*:refs/remotes/origin/*"
+	--prune --prune-tags origin "+refs/heads/*:refs/remotes/origin/*"
 test_configured_prune unset unset true  unset pruned kept \
-	"--prune origin +refs/heads/*:refs/remotes/origin/*"
+	--prune origin "+refs/heads/*:refs/remotes/origin/*"
 test_configured_prune unset unset unset true pruned  kept \
-	"--prune origin +refs/heads/*:refs/remotes/origin/*"
+	--prune origin "+refs/heads/*:refs/remotes/origin/*"
 
 # Pruning that also takes place if a file:// url replaces a named
 # remote. However, because there's no implicit
@@ -1033,15 +1033,15 @@  test_configured_prune_type_branch () {
 	test_configured_prune_type --mode name "$cfg_fp" "$cfg_rnp" "$cfg_fpt" "$cfg_rnpt" pruned "$arg_tag" "$@"
 	test_configured_prune_type --mode link "$cfg_fp" "$cfg_rnp" "$cfg_fpt" "$cfg_rnpt" kept   "$arg_tag" "$@"
 }
-test_configured_prune_type --mode name unset unset unset unset kept   kept   "origin --prune-tags"
-test_configured_prune_type --mode link unset unset unset unset kept   kept   "origin --prune-tags"
-test_configured_prune_type_branch unset unset unset unset - pruned "origin --prune --prune-tags"
-test_configured_prune_type_branch unset unset unset unset - pruned "--prune --prune-tags origin"
-test_configured_prune_type_branch unset unset true  unset - pruned "--prune origin"
-test_configured_prune_type_branch unset unset unset true  - pruned "--prune origin"
-test_configured_prune_type_branch true  unset true  unset - pruned "origin"
-test_configured_prune_type_branch unset  true true  unset - pruned "origin"
-test_configured_prune_type_branch unset  true unset true  - pruned "origin"
+test_configured_prune_type --mode name unset unset unset unset kept   kept   origin --prune-tags
+test_configured_prune_type --mode link unset unset unset unset kept   kept   origin --prune-tags
+test_configured_prune_type_branch unset unset unset unset - pruned origin --prune --prune-tags
+test_configured_prune_type_branch unset unset unset unset - pruned --prune --prune-tags origin
+test_configured_prune_type_branch unset unset true  unset - pruned --prune origin
+test_configured_prune_type_branch unset unset unset true  - pruned --prune origin
+test_configured_prune_type_branch true  unset true  unset - pruned origin
+test_configured_prune_type_branch unset  true true  unset - pruned origin
+test_configured_prune_type_branch unset  true unset true  - pruned origin
 
 # When all remote.origin.fetch settings are deleted a --prune
 # --prune-tags still implicitly supplies refs/tags/*:refs/tags/* so
@@ -1052,8 +1052,8 @@  test_expect_success 'remove remote.origin.fetch "one"' '
 		git config --unset-all remote.origin.fetch
 	)
 '
-test_configured_prune_type --mode name unset unset unset unset kept pruned "origin --prune --prune-tags"
-test_configured_prune_type --mode link unset unset unset unset kept pruned "origin --prune --prune-tags"
+test_configured_prune_type --mode name unset unset unset unset kept pruned origin --prune --prune-tags
+test_configured_prune_type --mode link unset unset unset unset kept pruned origin --prune --prune-tags
 
 test_expect_success 'all boundary commits are excluded' '
 	test_commit base &&