Skip to content

Commit 418db7d

Browse files
committed
Optimize context of git hunks
1 parent db0e47a commit 418db7d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/git.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ use crate::cmd;
1111
use anyhow::{bail, Result};
1212

1313
pub(crate) fn get_diffs() -> Result<String> {
14-
let output = cmd::run_command("git", &["diff", "--staged", "-w"])?;
14+
let output = cmd::run_command(
15+
"git",
16+
&[
17+
"diff",
18+
"--staged",
19+
"--ignore-all-space",
20+
"--diff-algorithm=minimal",
21+
"--function-context",
22+
],
23+
)?;
1524

1625
Ok(output)
1726
}

0 commit comments

Comments
 (0)