diff options
Diffstat (limited to 'crates/tools/src/bin')
-rw-r--r-- | crates/tools/src/bin/pre-commit.rs | 13 |
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 | } |