Skip to content

Fix test-only issue with git 2.20 or later handling a clobbered tag #837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions git/test/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,15 @@ def get_info(res, remote, name):
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)
Expand Down