Include tag name in the git treeish meta data
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 26 May 2014 14:13:32 +0000 (17:13 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 27 May 2014 12:08:34 +0000 (15:08 +0300)
Add tag name to the information returned by the
MirrorGitRepository.get_tag_info() method.  This information will also
be automatically written by the write_treeish_meta() function, and thus,
available in the meta data exported when using --git-meta.

Change-Id: Ibc20ac137c1102fea15a39a222f7dd228f5f5f99
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp_repocache/__init__.py
tests/test_obs_service_gbp_utils.py

index 09cdea9af6fa941f84a43e49af92be876669868a..d3772ef1af46225e37d881ec86bc8c6020fffce2 100644 (file)
@@ -127,6 +127,8 @@ class MirrorGitRepository(GitRepository): # pylint: disable=R0904
             match = tagger_re.match(line)
             if match:
                 info['tagger'] = match.groupdict()
+            if line.startswith('tag '):
+                info['tagname'] = line.split(' ', 1)[1]
             if not line:
                 break
 
index 972c0b22b7f5fa88cd7636cf859b56ac2f65a4b2..f83091e65860a91350772e3df7685da5f8d8a673 100644 (file)
@@ -150,7 +150,8 @@ class TestGitMeta(UnitTestsBase):
         cls.repo.create_tag('tag', msg='Subject\n\nBody')
 
         # Reference meta
-        cls.tag_meta = {'sha1': cls.repo.rev_parse('tag'),
+        cls.tag_meta = {'tagname': 'tag',
+                        'sha1': cls.repo.rev_parse('tag'),
                         'tagger': committer,
                         'subject': 'Subject',
                         'body': 'Body\n'}