Skip to content
Permalink
Browse files

Merge pull request #92 from jglick/ISE-JENKINS-42511

[JENKINS-42511] Make sure we do not attempt to create the same branch project twice
  • Loading branch information
stephenc committed Mar 8, 2017
2 parents 5f30c4e + c79800d commit 509a08caa65eb72c7c228fd46534c5899c50ecd3
@@ -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 " + MultiBranchProject.this);
}
project = _factory.newInstance(branch);
}
if (!project.getName().equals(encodedName)) {
@@ -1314,6 +1314,9 @@ public void complete() throws IllegalStateException, IOException, InterruptedExc
try (ChildNameGenerator.Trace trace = ChildNameGenerator.beforeCreateItem(
OrganizationFolder.this, folderName, projectName
)) {
if (getItem(folderName) != null) {
throw new IllegalStateException("JENKINS-42511: attempted to redundantly create " + folderName + " in " + OrganizationFolder.this);
}
project = factory.createNewProject(
OrganizationFolder.this, folderName, sources, attributes, listener
);

0 comments on commit 509a08c

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