From 9bb26401af7c4261bb08770719748dab9b4b55f1 Mon Sep 17 00:00:00 2001 From: Lingchaox Xin Date: Wed, 29 May 2013 10:40:55 +0800 Subject: [PATCH] Fix tag exsisting check logic We maybe need rev_parse method to ensure tag exsisting indeed, rather than simple str split. Change-Id: I672fc38b8d839d0fe54890fb7e339b1564585a32 --- job_submitobs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/job_submitobs.py b/job_submitobs.py index 392906d..b084e07 100755 --- a/job_submitobs.py +++ b/job_submitobs.py @@ -79,6 +79,10 @@ def find_submit_tag(event, mygit): tag = event['refname'][len('refs/tags/'):] event['branch'] = parse_submit_tag(tag)[0] event['patchset_revision'] = mygit.rev_parse(tag) + # Since patchset_revision is used in gerrit feedback, real tag check + # is needed; and the key point is parse_submit_tag can not ensure the + # tag exsisting too. + if not event['patchset_revision']: tag = None elif event['event_type'] == 'change-merged': # for chanage-merged, search submit tag on this commit branch = event['branch'] -- 2.7.4