diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/tools/src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index d6c448f3b..bc550c597 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs | |||
@@ -136,7 +136,9 @@ pub fn install_format_hook() -> Result<()> { | |||
136 | r#"#!/bin/sh | 136 | r#"#!/bin/sh |
137 | 137 | ||
138 | cargo format | 138 | cargo format |
139 | git update-index --add ."# | 139 | for path in $( git diff --name-only --cached ); do |
140 | git update-index --add $path | ||
141 | done"# | ||
140 | )?; | 142 | )?; |
141 | } else { | 143 | } else { |
142 | return Err(Error::new(ErrorKind::AlreadyExists, "Git hook already created").into()); | 144 | return Err(Error::new(ErrorKind::AlreadyExists, "Git hook already created").into()); |