Thread (4 messages) 4 messages, 2 authors, 2026-03-18
STALE95d

[PATCH 1/2] fetch: add a test for --force flag

From: Orgad Shaneh via GitGitGadget <hidden>
Date: 2026-02-15 20:23:39
Subsystem: the rest · Maintainer: Linus Torvalds

From: Orgad Shaneh <redacted>

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help