Context: My merge ran into conflicts and I have a file like this example:
Foo.txt (merged)
1
<<<<<< HEAD
2-master
======
2-side
>>>>>> df803849788fde47965b3dc8f07f07d48320ea9c
3
Question: In order to get the developers who actually changed the conflicting lines, how to blame result file (above) prior to the commit? It works for "git blame Foo.txt".
Problem: I tried to do the following, but the blame is null inside the loop.
MergeResult m = runMerge(aScenario);
BlameCommand blamer = new BlameCommand(git.getRepository());
BufferedReader br = new BufferedReader(new FileReader(new File(mergedfilepath)));
BlameResult blame = blamer.setFilePath(mergedfilepath).call();
for (int i = 0; (line= br.readLine())!=null ; i++) {
// the blame at this point is null.
PersonIdent person = blame.getSourceAuthor(i);
System.out.println(person.getName() + ": "+ line);
}