@Test
public void checkoutThreeSequentialSingleCommits() throws Exception {

	File dir = git.tempDirectory();
	File gitDir = new File(dir, Constants.DOT_GIT);
	File log = File.createTempFile("log", ".txt");
	BuildRepository repo = new BuildRepository(git.repo().getDirectory()
			.toURI().toString(), BuildRepository.BRANCH_DEFAULT, null);
	RevCommit commit1 = git.add("file.txt", "content");
	RepositoryCheckoutOperation op = new RepositoryCheckoutOperation(
			Collections.singletonList(repo), new FilePath(log));
	assertTrue(op.invoke(dir, null));
	CommitLogReader reader = new CommitLogReader();
	CommitLog cl = reader.parse(null, log);
	assertNotNull(cl);
	assertFalse(cl.isEmptySet());
	assertEquals(1, cl.toArray().length);
	assertEquals(commit1.name(), cl.iterator().next().getCommitId());
	assertTrue(log.delete());
	assertTrue(log.createNewFile());
	Repository gitRepo = new FileRepository(gitDir);
	assertFalse(git.repo().getDirectory().equals(gitRepo.getDirectory()));
	assertEquals(commit1, CommitUtils.getLatest(gitRepo));
	RevCommit commit2 = git.add("file.txt", "new content");
	assertTrue(op.invoke(dir, null));
	assertEquals(commit2, CommitUtils.getLatest(gitRepo));
	cl = reader.parse(null, log);
	assertNotNull(cl);
	assertFalse(cl.isEmptySet());
	assertEquals(1, cl.toArray().length);
	assertEquals(commit2.name(), cl.iterator().next().getCommitId());
	RevCommit commit3 = git.add("file.txt", "less content");
	assertTrue(op.invoke(dir, null));
	assertEquals(commit3, CommitUtils.getLatest(gitRepo));
	cl = reader.parse(null, log);
	assertNotNull(cl);
	assertFalse(cl.isEmptySet());
	assertEquals(1, cl.toArray().length);
	assertEquals(commit3.name(), cl.iterator().next().getCommitId());
}