summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2018-02-09 20:32:05 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-09 13:10:12 -0800
commitbf16ab795574c27ffa0fe180cede2d355de41619 (patch)
tree6c9cbc8ebe4a50de7049fa261d0be23582800670 /t
parentfetch tests: refactor in preparation for testing tag pruning (diff)
downloadtgif-bf16ab795574c27ffa0fe180cede2d355de41619.tar.xz
fetch tests: re-arrange arguments for future readability
Re-arrange the arguments to the test_configured_prune() function used in this test to pass the arguments to --fetch last. A subsequent change will test for more elaborate fetch arguments, including long refspecs. It'll be more readable to be able to wrap those on a new line of their own. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5510-fetch.sh82
1 files changed, 44 insertions, 38 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 11da97f9b7..ab8b25344d 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -551,10 +551,10 @@ set_config_tristate () {
test_configured_prune () {
fetch_prune=$1
remote_origin_prune=$2
- cmdline=$3
- expected_branch=$4
+ expected_branch=$3
+ cmdline=$4
- test_expect_success "prune fetch.prune=$1 remote.origin.prune=$2${3:+ $3}; branch:$4" '
+ test_expect_success "prune fetch.prune=$1 remote.origin.prune=$2${4:+ $4}; branch:$3" '
# make sure a newbranch is there in . and also in one
git branch -f newbranch &&
(
@@ -587,41 +587,47 @@ test_configured_prune () {
'
}
-test_configured_prune unset unset "" kept
-test_configured_prune unset unset "--no-prune" kept
-test_configured_prune unset unset "--prune" pruned
-
-test_configured_prune false unset "" kept
-test_configured_prune false unset "--no-prune" kept
-test_configured_prune false unset "--prune" pruned
-
-test_configured_prune true unset "" pruned
-test_configured_prune true unset "--prune" pruned
-test_configured_prune true unset "--no-prune" kept
-
-test_configured_prune unset false "" kept
-test_configured_prune unset false "--no-prune" kept
-test_configured_prune unset false "--prune" pruned
-
-test_configured_prune false false "" kept
-test_configured_prune false false "--no-prune" kept
-test_configured_prune false false "--prune" pruned
-
-test_configured_prune true false "" kept
-test_configured_prune true false "--prune" pruned
-test_configured_prune true false "--no-prune" kept
-
-test_configured_prune unset true "" pruned
-test_configured_prune unset true "--no-prune" kept
-test_configured_prune unset true "--prune" pruned
-
-test_configured_prune false true "" pruned
-test_configured_prune false true "--no-prune" kept
-test_configured_prune false true "--prune" pruned
-
-test_configured_prune true true "" pruned
-test_configured_prune true true "--prune" pruned
-test_configured_prune true true "--no-prune" kept
+# $1 config: fetch.prune
+# $2 config: remote.<name>.prune
+# $3 expect: branch to be pruned?
+# $4 git-fetch $cmdline:
+#
+# $1 $2 $3 $4
+test_configured_prune unset unset kept ""
+test_configured_prune unset unset kept "--no-prune"
+test_configured_prune unset unset pruned "--prune"
+
+test_configured_prune false unset kept ""
+test_configured_prune false unset kept "--no-prune"
+test_configured_prune false unset pruned "--prune"
+
+test_configured_prune true unset pruned ""
+test_configured_prune true unset pruned "--prune"
+test_configured_prune true unset kept "--no-prune"
+
+test_configured_prune unset false kept ""
+test_configured_prune unset false kept "--no-prune"
+test_configured_prune unset false pruned "--prune"
+
+test_configured_prune false false kept ""
+test_configured_prune false false kept "--no-prune"
+test_configured_prune false false pruned "--prune"
+
+test_configured_prune true false kept ""
+test_configured_prune true false pruned "--prune"
+test_configured_prune true false kept "--no-prune"
+
+test_configured_prune unset true pruned ""
+test_configured_prune unset true kept "--no-prune"
+test_configured_prune unset true pruned "--prune"
+
+test_configured_prune false true pruned ""
+test_configured_prune false true kept "--no-prune"
+test_configured_prune false true pruned "--prune"
+
+test_configured_prune true true pruned ""
+test_configured_prune true true pruned "--prune"
+test_configured_prune true true kept "--no-prune"
test_expect_success 'all boundary commits are excluded' '
test_commit base &&