Skip to content

Commit

Permalink
Merge pull request #77 from sunflowerit/test-annotated-tags
Browse files Browse the repository at this point in the history
[ADD] test for merging an annotated tag
  • Loading branch information
sbidoul authored Jul 23, 2023
2 parents fe1e0bb + 03cc2ce commit 4a706d7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def setUp(self):
commit 1 -> fork after -> remote 2
tag1
commit 2
annotated tag2
*remote2 (clone remote 1)
commit 1
commit 3
Expand All @@ -94,6 +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)
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 @@ -121,6 +124,24 @@ def test_minimal(self):
last_rev = git_get_last_rev(self.cwd)
self.assertEqual(last_rev, self.commit_1_sha)

def test_annotated_tag(self):
remotes = [{
'name': 'r1',
'url': self.url_remote1
}]
merges = [{
'remote': 'r1',
'ref': 'tag2'
}]
target = {
'remote': 'r1',
'branch': 'agg1'
}
repo = Repo(self.cwd, remotes, merges, target)
repo.aggregate()
last_rev = git_get_last_rev(self.cwd)
self.assertEqual(last_rev, self.commit_2_sha)

def test_simple_merge(self):
remotes = [{
'name': 'r1',
Expand Down

0 comments on commit 4a706d7

Please sign in to comment.