"feat(grabber): Update GitGrabber to ignore whitespace and blank lines in diff output"
This commit is contained in:
parent
6ae7ce6a57
commit
3bff96acab
@ -20,13 +20,24 @@ impl GitGrabber {
|
|||||||
.expect("Failed to get branch");
|
.expect("Failed to get branch");
|
||||||
|
|
||||||
let b = from_utf8(&branch.stdout).unwrap();
|
let b = from_utf8(&branch.stdout).unwrap();
|
||||||
String::from(b)
|
String::from(b.strip_suffix("\n").unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_diff() -> String {
|
pub fn get_diff() -> String {
|
||||||
// just to print
|
// just to print
|
||||||
let staged_files_output = Command::new("git")
|
let output = Command::new("git")
|
||||||
.args(["diff", "--staged"])
|
.args([
|
||||||
|
"diff",
|
||||||
|
"--staged",
|
||||||
|
"--ignore-all-space",
|
||||||
|
"--ignore-blank-lines",
|
||||||
|
"--ignore-cr-at-eol",
|
||||||
|
"--minimal",
|
||||||
|
"--no-prefix",
|
||||||
|
"--no-renames",
|
||||||
|
"--word-diff",
|
||||||
|
"--inter-hunk-context=0",
|
||||||
|
])
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to get diff");
|
.expect("Failed to get diff");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user