mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-06 13:48:50 +01:00
Rename get_line_changes
This commit is contained in:
parent
1f2bcf57ba
commit
b5c119e802
@ -105,7 +105,7 @@ fn print_file<P: AsRef<Path>>(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_line_changes(filename: String) -> Option<LineChanges> {
|
fn get_git_diff(filename: String) -> Option<LineChanges> {
|
||||||
let repo = Repository::open_from_env().ok()?;
|
let repo = Repository::open_from_env().ok()?;
|
||||||
|
|
||||||
let mut diff_options = DiffOptions::new();
|
let mut diff_options = DiffOptions::new();
|
||||||
@ -166,7 +166,7 @@ fn run(matches: &ArgMatches) -> Result<()> {
|
|||||||
|
|
||||||
if let Some(files) = matches.values_of("FILE") {
|
if let Some(files) = matches.values_of("FILE") {
|
||||||
for file in files {
|
for file in files {
|
||||||
let line_changes = get_line_changes(file.to_string());
|
let line_changes = get_git_diff(file.to_string());
|
||||||
print_file(theme, &syntax_set, file, line_changes)?;
|
print_file(theme, &syntax_set, file, line_changes)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user