Skip to content

Commit

Permalink
[JENKINS-26268] test checkout of remotes/origin/master with two repos…
Browse files Browse the repository at this point in the history
… defined
  • Loading branch information
MarkEWaite committed Jun 5, 2016
1 parent 88ef3e6 commit b0a4057
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/test/java/hudson/plugins/git/GitSCMTest.java
Expand Up @@ -904,8 +904,7 @@ public void testFetchFromMultipleRepositories() throws Exception {
assertFalse("scm polling should not detect any more changes after build", project.poll(listener).hasChanges());
}

@Issue("JENKINS-26268")
public void testBranchSpecAsSHA1WithMultipleRepositories() throws Exception {
private void branchSpecWithMultipleRepositories(String branchName) throws Exception {
FreeStyleProject project = setupSimpleProject("master");

TestGitRepo secondTestRepo = new TestGitRepo("second", tempFolder.newFolder(), listener);
Expand All @@ -917,11 +916,9 @@ public void testBranchSpecAsSHA1WithMultipleRepositories() throws Exception {
final String commitFile1 = "commitFile1";
commit(commitFile1, johnDoe, "Commit number 1");

String sha1 = testRepo.git.revParse("HEAD").getName();

project.setScm(new GitSCM(
remotes,
Collections.singletonList(new BranchSpec(sha1)),
Collections.singletonList(new BranchSpec(branchName)),
false, Collections.<SubmoduleConfig>emptyList(),
null, null,
Collections.<GitSCMExtension>emptyList()));
Expand All @@ -930,6 +927,16 @@ public void testBranchSpecAsSHA1WithMultipleRepositories() throws Exception {
rule.assertBuildStatusSuccess(build);
}

@Issue("JENKINS-26268")
public void testBranchSpecAsSHA1WithMultipleRepositories() throws Exception {
branchSpecWithMultipleRepositories(testRepo.git.revParse("HEAD").getName());
}

@Issue("JENKINS-26268")
public void testBranchSpecAsRemotesOriginMasterWithMultipleRepositories() throws Exception {
branchSpecWithMultipleRepositories("remotes/origin/master");
}

@Issue("JENKINS-25639")
@Test
public void testCommitDetectedOnlyOnceInMultipleRepositories() throws Exception {
Expand Down

0 comments on commit b0a4057

Please sign in to comment.