aboutsummaryrefslogtreecommitdiff
path: root/git/test
diff options
context:
space:
mode:
Diffstat (limited to 'git/test')
-rw-r--r--git/test/test_remote.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/git/test/test_remote.py b/git/test/test_remote.py
index 7c1711c2..99949b9e 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)
@@ -632,7 +638,7 @@ class TestRemote(TestBase):
def test_fetch_error(self):
rem = self.rorepo.remote('origin')
- with self.assertRaisesRegex(GitCommandError, "Couldn't find remote ref __BAD_REF__"):
+ with self.assertRaisesRegex(GitCommandError, "[Cc]ouldn't find remote ref __BAD_REF__"):
rem.fetch('__BAD_REF__')
@with_rw_repo('0.1.6', bare=False)