[jenkins] - use a new method to determine the branch name by ignoring the pr ref_spec...
authorMemphiz <memphis@machzwo.de>
Mon, 5 Aug 2013 19:34:25 +0000 (21:34 +0200)
committerMemphiz <memphis@machzwo.de>
Mon, 5 Aug 2013 19:34:25 +0000 (21:34 +0200)
tools/buildsteps/defaultenv

index 93d3c13..52d22ee 100644 (file)
@@ -119,7 +119,7 @@ function getBuildRevDateStr ()
   if [ "$?" == "0" ]
   then
     #fetch the first branch containing head
-    revStr=$revStr"-"`git branch -r --contains HEAD | sed "/origin\/pr\//d" | head -n1 | awk '{gsub(".*/","");print $1}'`
+    revStr=$revStr"-"`git name-rev --ref=refs/heads/* --name-only HEAD | head -n1 | awk '{gsub(".*/","");print $1}'`
     if [ "$?" == "0" ]
     then
       echo $revStr