From dff4bdd4be62a00d3090647b5a92b51cea730a84 Mon Sep 17 00:00:00 2001 From: "James E. King III" Date: Tue, 5 Feb 2019 19:48:09 -0500 Subject: Fix test-only issue with git 2.20 or later handling a clobbered tag --- git/test/test_remote.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'git') diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 7c1711c2..f3a214cb 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -253,9 +253,15 @@ class TestRemote(TestBase): self.assertEqual(tinfo.ref.commit, rtag.commit) self.assertTrue(tinfo.flags & tinfo.NEW_TAG) - # adjust tag commit + # adjust the local tag commit Reference.set_object(rtag, rhead.commit.parents[0].parents[0]) - res = fetch_and_test(remote, tags=True) + + # as of git 2.20 one cannot clobber local tags that have changed without + # specifying --force, and the test assumes you can clobber, so... + force = None + if rw_repo.git.version_info[:2] >= (2, 20): + force = True + res = fetch_and_test(remote, tags=True, force=force) tinfo = res[str(rtag)] self.assertEqual(tinfo.commit, rtag.commit) self.assertTrue(tinfo.flags & tinfo.TAG_UPDATE) -- cgit v1.2.1