Skip to content

Commit dff4bdd

Browse files
jeking3Byron
authored andcommitted
Fix test-only issue with git 2.20 or later handling a clobbered tag
1 parent 7a6ca8c commit dff4bdd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git/test/test_remote.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,15 @@ def get_info(res, remote, name):
253253
self.assertEqual(tinfo.ref.commit, rtag.commit)
254254
self.assertTrue(tinfo.flags & tinfo.NEW_TAG)
255255

256-
# adjust tag commit
256+
# adjust the local tag commit
257257
Reference.set_object(rtag, rhead.commit.parents[0].parents[0])
258-
res = fetch_and_test(remote, tags=True)
258+
259+
# as of git 2.20 one cannot clobber local tags that have changed without
260+
# specifying --force, and the test assumes you can clobber, so...
261+
force = None
262+
if rw_repo.git.version_info[:2] >= (2, 20):
263+
force = True
264+
res = fetch_and_test(remote, tags=True, force=force)
259265
tinfo = res[str(rtag)]
260266
self.assertEqual(tinfo.commit, rtag.commit)
261267
self.assertTrue(tinfo.flags & tinfo.TAG_UPDATE)

0 commit comments

Comments
 (0)