aboutsummaryrefslogtreecommitdiff
path: root/tools/buildsteps
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2014-11-05 20:29:58 +0100
committerMemphiz <memphis@machzwo.de>2014-11-05 20:29:58 +0100
commitd0857b1fce91afef1ad2fb7f8abbd5af4da107a4 (patch)
tree801b336d6ebeb530a1a784fe0ad9ecc18a35f742 /tools/buildsteps
parentaff8710eefa95a351c07d796781888034dd69b04 (diff)
[jenkins] - when trying to determine the branchname of a detached head revision - filter it so only branches from the currently built GITHUB_REPO are used (else we might pick the wrong branchname from another repo which was checked out before and contains the same revision)
Diffstat (limited to 'tools/buildsteps')
-rw-r--r--tools/buildsteps/defaultenv3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/buildsteps/defaultenv b/tools/buildsteps/defaultenv
index 0d14e16a89..d709f986a1 100644
--- a/tools/buildsteps/defaultenv
+++ b/tools/buildsteps/defaultenv
@@ -139,7 +139,8 @@ function getBranchName ()
else
#if we are in detached head state
#fetch the first non-pullrequest branch we can find with HEAD
- git branch -r --contains HEAD | sed "/origin\/pr\//d" | head -n1 | awk '{gsub(".*/","");print $1}'
+ #also only grep in remotes that match current GITHUB_REPO
+ git branch -r --contains HEAD | sed "/origin\/pr\//d" | grep $GITHUB_REPO | head -n1 | awk '{gsub(".*/","");print $1}'
fi
}