IFile fileA = testUtils.addFileToProject(project.getProject(),
"foo/a.txt", "some text");
IFile fileB = testUtils.addFileToProject(project.getProject(),
"foo/b.txt", "some text");
IFile[] filesToCommit = { fileA, fileB };
CommitOperation commitOperation = new CommitOperation(filesToCommit,
Arrays.asList(filesToCommit), TestUtils.AUTHOR,
TestUtils.COMMITTER, "first commit");
commitOperation.execute(null);
testUtils.changeContentOfFile(project.getProject(), fileA,
"new content of A");
testUtils.changeContentOfFile(project.getProject(), fileB,
"new content of B");
resources.add(fileA);
resources.add(fileB);
new AddToIndexOperation(resources).execute(null);
IFile[] filesToCommit2 = { fileA };
commitOperation = new CommitOperation(filesToCommit2, EMPTY_FILE_LIST,
TestUtils.AUTHOR, TestUtils.COMMITTER, "second commit");
commitOperation.execute(null);
testUtils.assertRepositoryContainsFilesWithContent(repository,
"foo/a.txt", "new content of A", "foo/b.txt", "some text");
}