Skip to content

Commit

Permalink
[JENKINS-35906] Ensure that SCMDescriptor.newInstance overrides are h…
Browse files Browse the repository at this point in the history
…onored (#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 1d176d1)
  • Loading branch information
jglick authored and olivergondza committed Aug 23, 2016
1 parent 97c1cbd commit 27d8f06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/scm/SCMS.java
Expand Up @@ -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;
}
Expand Down

0 comments on commit 27d8f06

Please sign in to comment.