From 635f975ef4370eeb804de974ab5dab44e3f75f8d Mon Sep 17 00:00:00 2001 From: Lingchaox Xin Date: Tue, 4 Mar 2014 16:32:16 +0800 Subject: [PATCH] Pylint common/git.py Change-Id: I410c4f48a7d75a261b5d2a45685aa57a8cefa2d9 --- common/git.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/git.py b/common/git.py index c65f22f..b7f1392 100644 --- a/common/git.py +++ b/common/git.py @@ -43,7 +43,7 @@ class Git(GitRepository): def get_tag(self, tag_name): """Get tag info though tag name""" - outs, _, ret = self._git_inout('show', + outs, err, ret = self._git_inout('show', ['-s', '--pretty=format:###', tag_name]) if ret: @@ -77,7 +77,8 @@ class Git(GitRepository): return tag def branch_contains(self, cmitid): - outs, _errs, ret = self._git_inout('branch', + """shows only the branches that contain the named commit(commitid)""" + outs, _, ret = self._git_inout('branch', ['-a', '--contains', cmitid]) if not ret: branches = [] @@ -121,7 +122,7 @@ def _clone_gitproject(giturl, gerritprj, localdir, bare=False): # fetch latest code if local dir already exists if os.path.isdir(localdir) and \ - _update_gitproject(localdir, gitpath="%s/%s" %(giturl,gerritprj)): + _update_gitproject(localdir, gitpath="%s/%s" %(giturl, gerritprj)): return True try: -- 2.7.4