Skip to content

Commit

Permalink
fixup! new: support annotated tags as merge source (fixes acsone#27, f…
Browse files Browse the repository at this point in the history
…ixes acsone#28)
  • Loading branch information
thomaspaulb committed Jul 18, 2023
1 parent 03f7a19 commit 80095d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions git_aggregator/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def query_remote(self, remote, refs=None):
for ref in refs:
yield None, ref, ref
return
for sha, fullref in (l.split() for l in out.splitlines()):
for sha, fullref in (line.split() for line in out.splitlines()):
if fullref.startswith('refs/heads/'):
yield 'branch', fullref, sha
elif fullref.startswith('refs/tags/'):
Expand Down Expand Up @@ -342,7 +342,10 @@ def push(self):
"Cannot push %s, no target remote configured" % branch
)
logger.info("Push %s to %s", branch, remote)
self.log_call(['git', 'push', '-f', remote, "HEAD:%s" % branch], cwd=self.cwd)
self.log_call(
['git', 'push', '-f', remote, "HEAD:%s" % branch],
cwd=self.cwd
)

def _check_status(self):
"""Check repo status and except if dirty."""
Expand Down
5 changes: 3 additions & 2 deletions tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def setUp(self):
subprocess.check_call(['git', 'tag', 'tag1'], cwd=self.remote1)
self.commit_2_sha = git_write_commit(
self.remote1, 'tracked', "last", msg="last commit")
subprocess.check_call(['git', 'tag', '-am', 'foo', 'tag2'], cwd=self.remote1)
subprocess.check_call(['git', 'tag', '-am', 'foo', 'tag2'],
cwd=self.remote1)
self.commit_3_sha = git_write_commit(
self.remote2, 'tracked2', "remote2", msg="new commit")
subprocess.check_call(['git', 'checkout', '-b', 'b2'],
Expand Down Expand Up @@ -171,7 +172,7 @@ def test_simple_merge(self):
self.assertTrue(sha)

def test_simple_merge_2(self):
## Launched from an existing git repository
# Launched from an existing git repository
remotes = [{
'name': 'r1',
'url': self.url_remote1
Expand Down

0 comments on commit 80095d8

Please sign in to comment.