@Test
public void cloneRepository() throws Exception {

	Repository existing = git.repo();
	RevCommit commit = git.add("file.txt", "abcd");
	BuildRepository repo = new BuildRepository(existing.getDirectory()
			.toURI().toString(), "master", null);
	File dir = git.tempDirectory();
	CloneOperation op = new CloneOperation(repo);
	Repository cloned = op.invoke(dir, null);
	assertNotNull(cloned);
	assertFalse(existing.getDirectory().equals(cloned.getDirectory()));
	assertTrue(new File(dir, Constants.DOT_GIT).exists());
	assertNotNull(CommitUtils.getCommit(cloned, commit));
}