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
|
r#"#!/bin/sh
|
||||||
|
|
||||||
cargo format
|
cargo format
|
||||||
git update-index --add ."#
|
for path in $( git diff --name-only --cached ); do
|
||||||
|
git update-index --add $path
|
||||||
|
done"#
|
||||||
)?;
|
)?;
|
||||||
} else {
|
} else {
|
||||||
return Err(Error::new(ErrorKind::AlreadyExists, "Git hook already created").into());
|
return Err(Error::new(ErrorKind::AlreadyExists, "Git hook already created").into());
|
||||||
|
Loading…
Reference in New Issue
Block a user