aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/fetch-git.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx
index c84843f..7650bf9 100644
--- a/bpkg/fetch-git.cxx
+++ b/bpkg/fetch-git.cxx
@@ -1409,6 +1409,12 @@ namespace bpkg
else if (verb > 3)
v.push_back ("-v");
+ // Note that passing --no-tags is not just an optimization. Not doing so
+ // we may end up with the "would clobber existing tag" git error for a
+ // changed tag (for example, the version tag advanced for revision) if
+ // the user has globally configured fetching all remote tags (via the
+ // remote.<name>.tagOpt option or similar).
+ //
// Also note that we don't need to specify --refmap option since we can
// rely on the init() function that properly sets the
// remote.origin.fetch configuration option.
@@ -1419,6 +1425,7 @@ namespace bpkg
co.git_option (),
"-C", dir,
"fetch",
+ "--no-tags",
"--no-recurse-submodules",
(shallow ? cstrings ({"--depth", "1"}) :
shallow_repo () ? cstrings ({"--unshallow"}) :