fetch tests: refactor in preparation for testing tag pruning
In a subsequent commit this function will learn to test for tag pruning, prepare for that by making space for more variables, and making it clear that "expected" here refers to branches. 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
eca142d30818bd9cfc0d3a6b38d6ae4dc4c500a0
1 file changed
+6
-3
t/t5510-fetch.sh
+6
-3
@@ -549,9 +549,12 @@ set_config_tristate () {
549
}
550
551
test_configured_prune () {
552
- fetch_prune=$1 remote_origin_prune=$2 cmdline=$3 expected=$4
552
+ fetch_prune=$1
553
+ remote_origin_prune=$2
554
+ cmdline=$3
555
+ expected_branch=$4
556
554
- test_expect_success "prune fetch.prune=$1 remote.origin.prune=$2${3:+ $3}; $4" '
557
+ test_expect_success "prune fetch.prune=$1 remote.origin.prune=$2${3:+ $3}; branch:$4" '
558
# make sure a newbranch is there in . and also in one
559
git branch -f newbranch &&
560
(
@@ -572,7 +575,7 @@ test_configured_prune () {
575
set_config_tristate remote.origin.prune $remote_origin_prune &&
576
577
git fetch $cmdline &&
575
- case "$expected" in
578
+ case "$expected_branch" in
579
pruned)
580
test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
581
;;