提交 27d8f06f 编写于 作者: J Jesse Glick 提交者: Oliver Gondža

[JENKINS-35906] Ensure that SCMDescriptor.newInstance overrides are honored (#2426)

* [FIXED JENKINS-35906] Ensure that SCMDescriptor.newInstance overrides are honored.

* [FIXED JENKINS-36043] Work around fragile form submission design in multi-branch-project-plugin.

(cherry picked from commit 1d176d1f)
上级 97c1cbd7
......@@ -56,7 +56,10 @@ public class SCMS {
*/
@SuppressWarnings("deprecation")
public static SCM parseSCM(StaplerRequest req, AbstractProject target) throws FormException, ServletException {
SCM scm = req.bindJSON(SCM.class, req.getSubmittedForm().getJSONObject("scm"));
SCM scm = SCM.all().newInstanceFromRadioList(req.getSubmittedForm().getJSONObject("scm"));
if (scm == null) {
scm = new NullSCM(); // JENKINS-36043 workaround for AbstractMultiBranchProject.submit
}
scm.getDescriptor().generation++;
return scm;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册