use of com.thoughtworks.go.domain.materials.git.GitTestRepo in project gocd by gocd.
the class GitCommandTest method shouldReturnNothingForModificationsSinceIfARebasedCommitSHAIsPassed.
@Test
public void shouldReturnNothingForModificationsSinceIfARebasedCommitSHAIsPassed() throws IOException {
GitTestRepo remoteRepo = new GitTestRepo(temporaryFolder);
executeOnGitRepo("git", "remote", "rm", "origin");
executeOnGitRepo("git", "remote", "add", "origin", remoteRepo.projectRepositoryUrl());
GitCommand command = new GitCommand(remoteRepo.createMaterial().getFingerprint(), gitLocalRepoDir, "master", false, new HashMap<>(), null);
Modification modification = remoteRepo.addFileAndAmend("foo", "amendedCommit").get(0);
assertThat(command.modificationsSince(new StringRevision(modification.getRevision())).isEmpty(), is(true));
}
use of com.thoughtworks.go.domain.materials.git.GitTestRepo in project gocd by gocd.
the class MixedMultipleMaterialsTest method createRepo.
@Before
public void createRepo() throws IOException {
svnRepo = new SvnTestRepo(temporaryFolder);
hgRepo = new HgTestRepo(temporaryFolder);
gitRepo = new GitTestRepo(temporaryFolder);
pipelineDir = temporaryFolder.newFolder();
}
use of com.thoughtworks.go.domain.materials.git.GitTestRepo in project gocd by gocd.
the class GitMaterialUpdaterTest method shouldLogRepoInfoToConsoleOutWithoutFolder.
@Test
public void shouldLogRepoInfoToConsoleOutWithoutFolder() throws Exception {
String repositoryUrl = new GitTestRepo(temporaryFolder).projectRepositoryUrl();
GitMaterial material = new GitMaterial(repositoryUrl, false);
updateTo(material, new RevisionContext(REVISION_1), JobResult.Passed);
assertThat(console.output(), containsString(format("Start updating %s at revision %s from %s", "files", REVISION_1.getRevision(), repositoryUrl)));
}
use of com.thoughtworks.go.domain.materials.git.GitTestRepo in project gocd by gocd.
the class GitMaterialUpdaterTest method cloneWithDeepWorkingDir.
@Test
public void cloneWithDeepWorkingDir() throws Exception {
GitMaterial material = new GitMaterial(new GitTestRepo(temporaryFolder).projectRepositoryUrl(), "", "foo/bar/baz", true);
updateTo(material, new RevisionContext(REVISION_4), JobResult.Passed);
assertThat(new File(workingDir, "foo/bar/baz/build.xml").exists(), is(true));
}
use of com.thoughtworks.go.domain.materials.git.GitTestRepo in project gocd by gocd.
the class GitMaterialUpdaterTest method shouldCleanDirtyFilesUponUpdate.
@Test
public void shouldCleanDirtyFilesUponUpdate() throws IOException {
String repositoryUrl = new GitTestRepo(temporaryFolder).projectRepositoryUrl();
GitMaterial material = new GitMaterial(repositoryUrl, true);
updateTo(material, new RevisionContext(REVISION_4), JobResult.Passed);
File shouldBeRemoved = new File(workingDir, "shouldBeRemoved");
assertTrue(shouldBeRemoved.createNewFile());
updateTo(material, new RevisionContext(REVISION_4), JobResult.Passed);
assertThat(shouldBeRemoved.exists(), is(false));
}
Aggregations