Skip to content
Permalink
Browse files
[FIXED JENKINS-19037] Ugly stack trace when saving configuration with…
… a missing repository URL.
  • Loading branch information
jglick committed Sep 21, 2013
1 parent c78bfce commit 42f15d870ec87fbd404f3a4b673ee068b9a5e6ad
Showing with 11 additions and 1 deletion.
  1. +5 −1 src/main/java/hudson/plugins/git/GitSCM.java
  2. +6 −0 src/test/java/hudson/plugins/git/GitSCMTest.java
@@ -1103,14 +1103,18 @@ public static List<RemoteConfig> createRepositoryConfigurations(String[] urls,

if (names != null) {
for (int i = 0; i < names.length; i++) {
String url = urls[i];
if (url == null) {
continue;
}
String name = names[i];
name = name.replace(' ', '_');

if (isBlank(refs[i])) {
refs[i] = "+refs/heads/*:refs/remotes/" + name + "/*";
}

repoConfig.setString("remote", name, "url", urls[i]);
repoConfig.setString("remote", name, "url", url);
repoConfig.setStringList("remote", name, "fetch", new ArrayList<String>(Arrays.asList(refs[i].split("\\s+"))));
}
}
@@ -594,6 +594,12 @@ public void testMultipleBranchBuild() throws Exception {
assertFalse("scm polling should not detect any more changes after last build", project.poll(listener).hasChanges());
}

@Bug(19037)
@SuppressWarnings("ResultOfObjectAllocationIgnored")
public void testBlankRepositoryName() throws Exception {
new GitSCM(null);
}

@Bug(10060)
public void testSubmoduleFixup() throws Exception {
File repo = createTmpDir();

0 comments on commit 42f15d8

Please sign in to comment.