@Test
public void fetchSingleCommit() throws Exception {

	git.add("file.txt", "a");
	File dir = git.tempDirectory();
	BuildRepository repo = new BuildRepository(git.repo().getDirectory()
			.toURI().toString(), Constants.R_HEADS + Constants.MASTER, null);
	CloneOperation clone = new CloneOperation(repo);
	Repository cloned = clone.invoke(dir, null);
	assertNotNull(cloned);
	RevCommit commit2 = git.add("file1.txt", "b");
	ByteArrayOutputStream out = new ByteArrayOutputStream();
	StreamProgressMonitor monitor = new StreamProgressMonitor(
			new PrintStream(out));
	FetchOperation fetch = new FetchOperation(repo, cloned, monitor);
	RevCommit fetched = fetch.call();
	assertEquals(commit2, fetched);
	assertTrue(out.toString().length() > 0);
}