summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. King III <jking@apache.org>2019-02-05 19:48:09 -0500
committerSebastian Thiel <byronimo@gmail.com>2019-03-15 12:43:17 +0100
commitdff4bdd4be62a00d3090647b5a92b51cea730a84 (patch)
treea1ef65d6bc7ac2eacf751214e1ce05542895bdf9
parent7a6ca8c40433400f6bb3ece2ed30808316de5be3 (diff)
downloadgitpython-dff4bdd4be62a00d3090647b5a92b51cea730a84.tar.gz
Fix test-only issue with git 2.20 or later handling a clobbered tag
-rw-r--r--git/test/test_remote.py10
1 files changed, 8 insertions, 2 deletions
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)