]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fix: pipe not usable that easy
authorMathias Klette <mathias.klette@profitbricks.com>
Fri, 16 Sep 2011 18:09:44 +0000 (20:09 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Fri, 16 Sep 2011 18:09:44 +0000 (20:09 +0200)
lib/git_helper.py

index 3690ecae25ac16c81127665e64711ad3fa4101bf..769fd9716ee945fa8e8367e30cd5e2c2958b544a 100644 (file)
@@ -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