From: Markus Lehtonen Date: Mon, 26 May 2014 14:13:32 +0000 (+0300) Subject: Include tag name in the git treeish meta data X-Git-Tag: submit/devel/20190730.075437~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed7405aa4d47f81ea9bf606bde9a3fee03896284;p=services%2Fobs-service-git-buildpackage.git Include tag name in the git treeish meta data 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 --- diff --git a/gbp_repocache/__init__.py b/gbp_repocache/__init__.py index 09cdea9..d3772ef 100644 --- a/gbp_repocache/__init__.py +++ b/gbp_repocache/__init__.py @@ -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 diff --git a/tests/test_obs_service_gbp_utils.py b/tests/test_obs_service_gbp_utils.py index 972c0b2..f83091e 100644 --- a/tests/test_obs_service_gbp_utils.py +++ b/tests/test_obs_service_gbp_utils.py @@ -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'}