aboutsummaryrefslogtreecommitdiff
path: root/crates/tools/src
diff options
context:
space:
mode:
authorDJMcNab <[email protected]>2018-12-09 10:37:04 +0000
committerDJMcNab <[email protected]>2018-12-09 10:37:04 +0000
commit279ff4927ade19c51553ea36147605c6ff4347ae (patch)
tree9ca66e58147b6b5049053088659659d74d4b5da0 /crates/tools/src
parente823db06985d6782ff3803d3a4dea67a3c18426c (diff)
Update hook to not add unstaged files
Diffstat (limited to 'crates/tools/src')
-rw-r--r--crates/tools/src/lib.rs4
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
138cargo format 138cargo format
139git update-index --add ."# 139for path in $( git diff --name-only --cached ); do
140 git update-index --add $path
141done"#
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());