Skip to content

Commit

Permalink
[JENKINS-42511] Make sure we do not attempt to create the same branch…
Browse files Browse the repository at this point in the history
… project twice.
  • Loading branch information
jglick committed Mar 7, 2017
1 parent 7184165 commit 61a48b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/jenkins/branch/MultiBranchProject.java
Expand Up @@ -2043,8 +2043,11 @@ public void observe(@NonNull SCMHead head, @NonNull SCMRevision revision) {
return;
}
try (ChildNameGenerator.Trace trace = ChildNameGenerator.beforeCreateItem(
MultiBranchProject.this, branch.getEncodedName(), branch.getName()
MultiBranchProject.this, encodedName, branch.getName()
)){
if (getItem(encodedName) != null) {
throw new IllegalStateException("JENKINS-42511: attempted to redundantly create " + encodedName + " in " + this);
}
project = _factory.newInstance(branch);
}
if (!project.getName().equals(encodedName)) {
Expand Down

0 comments on commit 61a48b1

Please sign in to comment.