aboutsummaryrefslogtreecommitdiff
path: root/crates/tools/src/bin
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
committerAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
commit12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch)
tree71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/tools/src/bin
parent5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff)
reformat the world
Diffstat (limited to 'crates/tools/src/bin')
-rw-r--r--crates/tools/src/bin/pre-commit.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/tools/src/bin/pre-commit.rs b/crates/tools/src/bin/pre-commit.rs
index e00bd0d3d..ea18c0863 100644
--- a/crates/tools/src/bin/pre-commit.rs
+++ b/crates/tools/src/bin/pre-commit.rs
@@ -19,19 +19,10 @@ fn update_staged() -> Result<()> {
19 .current_dir(&root) 19 .current_dir(&root)
20 .output()?; 20 .output()?;
21 if !output.status.success() { 21 if !output.status.success() {
22 bail!( 22 bail!("`git diff --diff-filter=MAR --name-only --cached` exited with {}", output.status);
23 "`git diff --diff-filter=MAR --name-only --cached` exited with {}",
24 output.status
25 );
26 } 23 }
27 for line in String::from_utf8(output.stdout)?.lines() { 24 for line in String::from_utf8(output.stdout)?.lines() {
28 run( 25 run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?;
29 &format!(
30 "git update-index --add {}",
31 root.join(line).to_string_lossy()
32 ),
33 ".",
34 )?;
35 } 26 }
36 Ok(()) 27 Ok(())
37} 28}