提交 d990ed58 编写于 作者: J Jesse Glick

createProjectFromXML is not supposed to be called for a project which already...

createProjectFromXML is not supposed to be called for a project which already exists, but failed to enforce this.
上级 ad1c316e
...@@ -223,6 +223,10 @@ public abstract class ItemGroupMixIn { ...@@ -223,6 +223,10 @@ public abstract class ItemGroupMixIn {
acl.checkPermission(Item.CREATE); acl.checkPermission(Item.CREATE);
Jenkins.getInstance().getProjectNamingStrategy().checkName(name); Jenkins.getInstance().getProjectNamingStrategy().checkName(name);
if (parent.getItem(name) != null) {
throw new IllegalArgumentException(parent.getDisplayName() + " already contains an item '" + name + "'");
}
// place it as config.xml // place it as config.xml
File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); File configXml = Items.getConfigFile(getRootDirFor(name)).getFile();
configXml.getParentFile().mkdirs(); configXml.getParentFile().mkdirs();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册