From 8ede824623edb1fb7e18a23c1d4d449fdc67037a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 29 Aug 2013 16:54:52 +0200 Subject: [PATCH] Mark the branches matched by the branchRegex (cherry picked from commit ca42cb0) --- src/main/groovy/com/entagen/jenkins/GitApi.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/com/entagen/jenkins/GitApi.groovy b/src/main/groovy/com/entagen/jenkins/GitApi.groovy index 0c1e857c..affcedaf 100644 --- a/src/main/groovy/com/entagen/jenkins/GitApi.groovy +++ b/src/main/groovy/com/entagen/jenkins/GitApi.groovy @@ -11,12 +11,13 @@ class GitApi { List branchNames = [] eachResultLine(command) { String line -> - println "\t$line" - // lines are in the format of: \trefs/heads/BRANCH_NAME - // ex: b9c209a2bf1c159168bf6bc2dfa9540da7e8c4a26\trefs/heads/master String branchNameRegex = "^.*\trefs/heads/(.*)\$" String branchName = line.find(branchNameRegex) { full, branchName -> branchName } - if (passesFilter(branchName)) branchNames << branchName + Boolean selected = passesFilter(branchName) + println "\t" + (selected ? "* " : " ") + "$line" + // lines are in the format of: \trefs/heads/BRANCH_NAME + // ex: b9c209a2bf1c159168bf6bc2dfa9540da7e8c4a26\trefs/heads/master + if (selected) branchNames << branchName } return branchNames