Skip to content
Permalink
Browse files
Merge pull request #205 from pauxus/21952-tags-with-slashes
[JENKINS-21952] Resolve tags with slashes
  • Loading branch information
MarkEWaite committed Mar 15, 2014
2 parents e6b41fb + 4ad4791 commit 7b8955796e87c8d1a0974cb07a1cba82c5e15e11
Showing 1 changed file with 10 additions and 7 deletions.
@@ -71,14 +71,8 @@ public Collection<Revision> getCandidateRevisions(boolean isPollCall, String sin

Collection<Revision> revisions = new ArrayList<Revision>();

// if it doesn't contain '/' then it could be either a tag or an unqualified branch
// if it doesn't contain '/' then it could be an unqualified branch
if (!singleBranch.contains("/")) {
// the 'branch' could actually be a tag:
Set<String> tags = git.getTagNames(singleBranch);
if(tags.size() != 0) {
verbose(listener, "{0} is a tag");
return getHeadRevision(isPollCall, singleBranch, git, listener, data);
}

// <tt>BRANCH</tt> is recognized as a shorthand of <tt>*/BRANCH</tt>
// so check all remotes to fully qualify this branch spec
@@ -112,6 +106,15 @@ public Collection<Revision> getCandidateRevisions(boolean isPollCall, String sin
}
}

if (revisions.isEmpty()) {
// the 'branch' could actually be a non branch reference (for example a tag or a gerrit change)

revisions = getHeadRevision(isPollCall, singleBranch, git, listener, data);
if (!revisions.isEmpty()) {
verbose(listener, "{0} seems to be a non-branch reference (tag?)");
}
}

return revisions;
}

0 comments on commit 7b89557

Please sign in to comment.