Skip to content
Permalink
Browse files

[FIXED JENKINS-11460] "Repository URL" field in mercurial plugin shou…

…ld trim input
  • Loading branch information...
davidmc24 committed Oct 28, 2011
1 parent 36e5efe commit 3ffdb3e767d6b669955719e41e6561f5aa54c4d7
@@ -95,7 +95,7 @@
@DataBoundConstructor
public MercurialSCM(String installation, String source, String branch, String modules, String subdir, HgBrowser browser, boolean clean) {
this.installation = installation;
this.source = source;
this.source = Util.fixEmptyAndTrim(source);
this.modules = Util.fixNull(modules);
this.subdir = Util.fixEmptyAndTrim(subdir);
this.clean = clean;
@@ -6,6 +6,7 @@
import hudson.model.AbstractBuild;
import hudson.model.FreeStyleProject;
import hudson.model.ParametersAction;
import hudson.model.Result;
import hudson.model.StringParameterValue;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
@@ -423,6 +424,17 @@ public void testPolling() throws Exception {
pr = pollSCMChanges(p);
assertPollingResult(PollingResult.Change.SIGNIFICANT, cs4, cs5, pr);
}

@Bug(11460)
public void testTrailingUrlWhitespace() throws Exception {
FreeStyleProject p = createFreeStyleProject();
p.setScm(new MercurialSCM(hgInstallation, repo.getPath() + " ", null,
null, null, null, false));
hg(repo, "init");
touchAndCommit(repo, "dir1/f1");
AbstractBuild<?, ?> b = p.scheduleBuild2(0).get();
assertEquals(Result.SUCCESS, b.getResult());
}

private PretendSlave createNoopPretendSlave() throws Exception {
return createPretendSlave(new NoopFakeLauncher());

0 comments on commit 3ffdb3e

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