Update hook to not add unstaged files

This commit is contained in:
DJMcNab 2018-12-09 10:37:04 +00:00
parent e823db0698
commit 279ff4927a

View File

@ -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());