Skip to content

Commit 8c6462e

Browse files
committed
fetch: add a test for --force flag
There are two ways to force-fetch tags that have changed: either by specifying an explicit forced ref (+refs/tags/*:refs/tags/*), or by using --force. The first approach was already tested, but the second was not. This has now been addressed.
1 parent 852829b commit 8c6462e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/t5516-fetch-push.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,10 @@ test_force_fetch_tag () {
11051105
git commit -m 'file1' &&
11061106
git tag $tag_args testTag &&
11071107
test_must_fail git -C ../child1 fetch origin tag testTag &&
1108-
git -C ../child1 fetch origin '+refs/tags/*:refs/tags/*'
1108+
git -C ../child1 fetch origin '+refs/tags/*:refs/tags/*' &&
1109+
git tag $tag_args testTag HEAD^ &&
1110+
test_must_fail git -C ../child1 fetch origin tag testTag &&
1111+
git -C ../child1 fetch --force origin tag testTag
11091112
)
11101113
"
11111114
}

0 commit comments

Comments
 (0)