private void formatDiffs(final List<FileDiff> diffs) {
final Repository repository = fileViewer.getRepository();
Job formatJob = new Job(UIText.GitHistoryPage_FormatDiffJobName) {
protected IStatus run(IProgressMonitor monitor) {
final IDocument document = new Document();
final DiffStyleRangeFormatter formatter = new DiffStyleRangeFormatter(
document);
monitor.beginTask("", diffs.size()); //$NON-NLS-1$
for (FileDiff diff : diffs) {
if (monitor.isCanceled())
break;
if (diff.getCommit().getParentCount() > 1)
break;
monitor.setTaskName(diff.getPath());
try {
formatter.write(repository, diff);
} catch (IOException ignore) {
// Ignored
}
monitor.worked(1);
}