[PATCH 1/2] fetch: add a test for --force flag
- From
Orgad Shaneh via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Feb 15, 2026, 20:23 UTC
- Message-ID
- <3ef70fe673170925ccf2901a625fb458837e9fcf.1771187016.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2200.git.git.1771187016.gitgitgadget@gmail.com>
From: Orgad Shaneh <orgad.shaneh@audiocodes.com>
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.
Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com> --- t/t5516-fetch-push.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 29e2f17608..31df7faf56 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1105,7 +1105,10 @@ test_force_fetch_tag () { git commit -m 'file1' && git tag $tag_args testTag && test_must_fail git -C ../child1 fetch origin tag testTag && - git -C ../child1 fetch origin '+refs/tags/*:refs/tags/*' + git -C ../child1 fetch origin '+refs/tags/*:refs/tags/*' && + git tag $tag_args testTag HEAD^ && + test_must_fail git -C ../child1 fetch origin tag testTag && + git -C ../child1 fetch --force origin tag testTag ) " }
-- gitgitgadget