aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-05-01 09:33:38 (GMT)
committerKaren Arutyunov <karen@codesynthesis.com>2019-05-01 10:19:13 (GMT)
commit3ac33926fb98740d7da4bb33961dea9b68a5d19c (patch)
treeea175b6b3b71c4607ebaf2c747e8c6faa3cdd2fc
parenteff033b7a1317de816c83d8c185c44a7f452112c (diff)
Fix rep-fetch test failing for git 2.21.0
-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"}) :