Update hook to not add unstaged files
This commit is contained in:
parent
e823db0698
commit
279ff4927a
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user