Skip to content
Permalink
Browse files

Merge pull request #51 from fugi/fixRemoteName

JENKINS-46624
  • Loading branch information...
klimas7 committed Sep 3, 2017
2 parents 144d11a + 8983760 commit def2346a85827489536e0fd93dd3dcea6ed5b798
@@ -289,7 +289,7 @@ public int compareTo(GitParameterDefinition pd) {
}

if (isBranchType()) {
Set<String> branchSet = getBranch(gitClient, gitUrl);
Set<String> branchSet = getBranch(gitClient, gitUrl, repository.getName());
sortAndPutToParam(branchSet, paramList);
}

@@ -302,7 +302,6 @@ public int compareTo(GitParameterDefinition pd) {
sortAndPutToParam(pullRequestSet, paramList);
}
}
break;
}
}
} catch (Exception e) {
@@ -343,14 +342,14 @@ private boolean isPullRequestType() {
return tagSet;
}

private Set<String> getBranch(GitClient gitClient, String gitUrl) throws InterruptedException {
private Set<String> getBranch(GitClient gitClient, String gitUrl, String remoteName) throws InterruptedException {
Set<String> branchSet = new HashSet<String>();
Pattern branchFilterPattern = compileBranchFilterPattern();

Map<String, ObjectId> branches = gitClient.getRemoteReferences(gitUrl, null, true, false);
Iterator<String> remoteBranchesName = branches.keySet().iterator();
while (remoteBranchesName.hasNext()) {
String branchName = strip(remoteBranchesName.next(), DEFAULT_REMOTE);
String branchName = strip(remoteBranchesName.next(), remoteName);
Matcher matcher = branchFilterPattern.matcher(branchName);
if (matcher.matches()) {
if (matcher.groupCount() == 1) {

0 comments on commit def2346

Please sign in to comment.
You can’t perform that action at this time.