Skip to content

Commit eca142d

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 750d0da commit eca142d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

t/t5510-fetch.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,12 @@ set_config_tristate () {
549549
}
550550

551551
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
553556

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" '
555558
# make sure a newbranch is there in . and also in one
556559
git branch -f newbranch &&
557560
(
@@ -572,7 +575,7 @@ test_configured_prune () {
572575
set_config_tristate remote.origin.prune $remote_origin_prune &&
573576
574577
git fetch $cmdline &&
575-
case "$expected" in
578+
case "$expected_branch" in
576579
pruned)
577580
test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
578581
;;

0 commit comments

Comments
 (0)