From d9bedc00bbe156a9725693506115bb601252c72f Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Fri, 16 Sep 2011 20:09:44 +0200 Subject: [PATCH] fix: pipe not usable that easy --- lib/git_helper.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/git_helper.py b/lib/git_helper.py index 3690eca..769fd97 100644 --- a/lib/git_helper.py +++ b/lib/git_helper.py @@ -251,8 +251,7 @@ def git_get_treeish(refname): cmd = [ GIT, 'show', '--oneline', - '%s' % refname, - '|awk \'{print $1}\'' + '%s' % refname ] cmdobj = subprocess.Popen( cmd, @@ -283,10 +282,13 @@ def git_get_treeish(refname): ) return None else: - stdout_str = cmdobj.stdout.read() + stdout_str = cmdobj.stdout.read().split(" ") logger.debug( - 'found treeish "%s" for refspec "%s"' % (refname, stdout_str) + 'found treeish "%s" for refspec "%s", log: "%s"' % ( + refname, + stdout_str[0], + " ".join(stdout_str[1:]) ) - return stdout_str + return stdout_str[0] # vim: autoindent smartindent tabstop=4 expandtab shiftwidth=4 softtabstop=4 nu enc=utf-8 cinwords=if,elif,else,for,while,try,except,finally,def,class -- 2.39.5