From 408e54977fe7613172b50a50c4cc0148de34abbb Mon Sep 17 00:00:00 2001 From: Roger Zurawicki Date: Mon, 27 Feb 2023 08:40:01 -0500 Subject: [PATCH] Optimize context of git hunks --- src/git.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/git.rs b/src/git.rs index afb87fe..1dc276c 100644 --- a/src/git.rs +++ b/src/git.rs @@ -11,7 +11,16 @@ use crate::cmd; use anyhow::{bail, Result}; pub(crate) fn get_diffs() -> Result { - let output = cmd::run_command("git", &["diff", "--staged", "-w"])?; + let output = cmd::run_command( + "git", + &[ + "diff", + "--staged", + "--ignore-all-space", + "--diff-algorithm=minimal", + "--function-context", + ], + )?; Ok(output) }