use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitMoveDeleteHookTest method initRepoAboveProject.
private TestProject initRepoAboveProject(String srcParent, String d, boolean insidews) throws Exception {
registerWorkspaceRelativeTestDir(srcParent);
TestProject project = new TestProject(true, srcParent + "Project-1", insidews, workspaceSupplement);
File gd = new File(insidews ? workspace : workspaceSupplement, d);
File gitDir = new File(gd, Constants.DOT_GIT);
testDirs.add(gitDir);
testRepository = new TestRepository(gitDir);
repository = testRepository.getRepository();
testRepository.connect(project.getProject());
return project;
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class IndexDiffCacheEntryTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
testRepository = new TestRepository(gitDir);
repository = testRepository.getRepository();
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitSynchronizeDataTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
TestRepository testRepo = new TestRepository(gitDir);
testRepo.connect(project.project);
repo = RepositoryMapping.getMapping(project.project).getRepository();
// make initial commit
try (Git git = new Git(repo)) {
git.commit().setAuthor("JUnit", "junit@jgit.org").setMessage("Initial commit").call();
}
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class CloneOperationTest method setUp.
@Before
public void setUp() throws Exception {
workdir = testUtils.createTempDir("Repository1");
workdir2 = testUtils.createTempDir("Repository2");
repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));
File file = new File(workdir, "file1.txt");
FileUtils.createNewFile(file);
try (Git git = new Git(repository1.getRepository())) {
git.add().addFilepattern("file1.txt").call();
git.commit().setMessage("first commit").call();
git.tag().setName("tag").call();
file = new File(workdir, "file2.txt");
FileUtils.createNewFile(file);
git.add().addFilepattern("file2.txt").call();
git.commit().setMessage("second commit").call();
git.branchCreate().setName("dev").call();
file = new File(workdir, "file3.txt");
FileUtils.createNewFile(file);
git.add().addFilepattern("file3.txt").call();
git.commit().setMessage("third commit").call();
}
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class CommitOperationTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
gitDir = new File(project.getProject().getLocationURI().getPath(), Constants.DOT_GIT);
testRepository = new TestRepository(gitDir);
repository = testRepository.getRepository();
testRepository.connect(project.getProject());
}
Aggregations