patchList = null;
}
}
Patch.Key currentFileKey = null;
PatchFile currentFileData = null;
for (final PatchLineComment c : inlineComments) {
final Patch.Key pk = c.getKey().getParentKey();
final int lineNbr = c.getLine();
final short side = c.getSide();
if (!pk.equals(currentFileKey)) {
cmts.append("....................................................\n");
if (Patch.COMMIT_MSG.equals(pk.get())) {
cmts.append("Commit Message\n");
} else {
cmts.append("File ");
cmts.append(pk.get());
cmts.append("\n");
}
currentFileKey = pk;
if (patchList != null) {
try {
currentFileData =
new PatchFile(repo, patchList, pk.getFileName());
} catch (IOException e) {
// Don't quote the line if we can't load it.
}
} else {
currentFileData = null;
}
}
if (currentFileData != null) {
int maxLines;
try {
maxLines = currentFileData.getLineCount(side);
} catch (Throwable e) {
maxLines = lineNbr;
}
final int startLine = Math.max(1, lineNbr - lines + 1);