diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index d6c448f3b11..bc550c5978c 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -136,7 +136,9 @@ pub fn install_format_hook() -> Result<()> { r#"#!/bin/sh cargo format -git update-index --add ."# +for path in $( git diff --name-only --cached ); do + git update-index --add $path +done"# )?; } else { return Err(Error::new(ErrorKind::AlreadyExists, "Git hook already created").into());