@Test
public void testSimpleGitPatch() throws Exception {
RevCommit secondCommit = testRepository.appendContentAndCommit(
project.getProject(), file, "another line", "2nd commit");
CreatePatchOperation operation = new CreatePatchOperation(
testRepository.getRepository(), secondCommit);
operation.execute(new NullProgressMonitor());
String patchContent = operation.getPatchContent();
assertNotNull(patchContent);
assertGitPatch(SIMPLE_GIT_PATCH_CONTENT, patchContent);
// repeat setting the header format explicitly
operation = new CreatePatchOperation(
testRepository.getRepository(), secondCommit);
operation.setHeaderFormat(DiffHeaderFormat.EMAIL);
operation.execute(new NullProgressMonitor());
patchContent = operation.getPatchContent();
assertNotNull(patchContent);
assertGitPatch(SIMPLE_GIT_PATCH_CONTENT, patchContent);
}