Fix the issue of parse commit a tag point to test-tzs-appliance
authorLin Yang <lin.a.yang@intel.com>
Tue, 24 Sep 2013 08:08:48 +0000 (16:08 +0800)
committerLin Yang <lin.a.yang@intel.com>
Tue, 24 Sep 2013 08:08:48 +0000 (16:08 +0800)
When use 'git rev-parse' to parse the commit a tag point to, it should add
^{commit} after tag name, otherwise git will return the tag SHA1.

Change-Id: I0791f96350b01b458417fcbc27f14b58b79c5742
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
job_submitobs.py

index adb2651..7731ae9 100755 (executable)
@@ -93,7 +93,7 @@ def find_submit_tag(event, mygit):
         # is needed; and the key point is parse_submit_tag can not ensure the
         # tag exsisting too.
         try:
-            event['patchset_revision'] = mygit.rev_parse(tag)
+            event['patchset_revision'] = mygit.rev_parse('%s^{commit}' % tag)
         except GitRepositoryError:
             tag = None
     elif event['event_type'] == 'change-merged':