fetch tests: test --prune and refspec interaction
Add a test for the interaction between explicitly provided refspecs and fetch.prune. There's no point in adding this boilerplate to every combination of unset/false/true, it's instructive and sufficient to show that no matter if the variable is unset, false or true the refspec on the command-line overrides any configuration variable. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 9, 2018 at 20:32 UTC
6fb23f56c16c0981a2f7b46f53ac3af12b247996
1 file changed
+12
t/t5510-fetch.sh
+12
@@ -609,6 +609,10 @@ test_configured_prune () {
609
test_configured_prune unset unset kept kept ""
610
test_configured_prune unset unset kept kept "--no-prune"
611
test_configured_prune unset unset pruned kept "--prune"
612
+test_configured_prune unset unset kept pruned \
613
+ "--prune origin refs/tags/*:refs/tags/*"
614
+test_configured_prune unset unset pruned pruned \
615
+ "--prune origin refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*"
616
617
test_configured_prune false unset kept kept ""
618
test_configured_prune false unset kept kept "--no-prune"
@@ -625,6 +629,10 @@ test_configured_prune unset false pruned kept "--prune"
629
test_configured_prune false false kept kept ""
630
test_configured_prune false false kept kept "--no-prune"
631
test_configured_prune false false pruned kept "--prune"
632
+test_configured_prune false false kept pruned \
633
+ "--prune origin refs/tags/*:refs/tags/*"
634
+test_configured_prune false false pruned pruned \
635
+ "--prune origin refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*"
636
637
test_configured_prune true false kept kept ""
638
test_configured_prune true false pruned kept "--prune"
@@ -641,6 +649,10 @@ test_configured_prune false true pruned kept "--prune"
649
test_configured_prune true true pruned kept ""
650
test_configured_prune true true pruned kept "--prune"
651
test_configured_prune true true kept kept "--no-prune"
652
+test_configured_prune true true kept pruned \
653
+ "--prune origin refs/tags/*:refs/tags/*"
654
+test_configured_prune true true pruned pruned \
655
+ "--prune origin refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*"
656
657
test_expect_success 'all boundary commits are excluded' '
658
test_commit base &&