Query git diff only when needed

In large git repo like chromium, it takes too long time to query git
diff.
pull/302/head
shik Chen 6 years ago committed by David Peter
parent f0d936763c
commit 4e3ab4d399

@ -113,9 +113,13 @@ impl<'a> InteractivePrinter<'a> {
}
// Get the Git modifications
let line_changes = match file {
InputFile::Ordinary(filename) => get_git_diff(filename),
_ => None,
let line_changes = if config.output_components.changes() {
match file {
InputFile::Ordinary(filename) => get_git_diff(filename),
_ => None,
}
} else {
None
};
// Determine the type of syntax for highlighting

Loading…
Cancel
Save