Allow using asterisk '*' in branches parameter for git-mirror jobs

Related: PROD-27028 (PROD:27028)

Change-Id: I4509df6e62ac35d19f8a37cc1338f9966be3e5d1
diff --git a/git-mirror-pipeline.groovy b/git-mirror-pipeline.groovy
index 8bfe467..8766678 100644
--- a/git-mirror-pipeline.groovy
+++ b/git-mirror-pipeline.groovy
@@ -4,7 +4,11 @@
   timeout(time: 12, unit: 'HOURS') {
     node() {
       try{
-        def branches = BRANCHES.tokenize(',')
+        if (BRANCHES.equals("*") || BRANCHES.contains('*')) {
+          branches = git.getBranchesForGitRepo(SOURCE_URL, BRANCHES)
+        } else {
+          branches = BRANCHES.tokenize(',')
+        }
         def pollBranches = []
         for (i=0; i < branches.size(); i++) {
             pollBranches.add([name:branches[i]])