Skip to content

Commit

Permalink
[JENKINS-41124] Forgot to return the match when we find it first time
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Jan 18, 2017
1 parent 15561c5 commit 89d7ade
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/java/jenkins/branch/MultiBranchProject.java
Expand Up @@ -558,7 +558,10 @@ public P getItem(String name) {
return null;
}
P item = super.getItem(name);
if (item == null && name.indexOf('%') != -1) {
if (item != null) {
return item;
}
if (name.indexOf('%') != -1) {
String decoded = NameEncoder.decode(name);
item = super.getItem(decoded);
if (item != null) {
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/jenkins/branch/OrganizationFolder.java
Expand Up @@ -226,7 +226,10 @@ public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOExcep
return null;
}
MultiBranchProject<?, ?> item = super.getItem(name);
if (item == null && name.indexOf('%') != -1) {
if (item != null) {
return item;
}
if (name.indexOf('%') != -1) {
String decoded = NameEncoder.decode(name);
item = super.getItem(decoded);
if (item != null) {
Expand Down

0 comments on commit 89d7ade

Please sign in to comment.