diff options
author | Muhammad Mominul Huque <[email protected]> | 2019-06-15 19:48:50 +0100 |
---|---|---|
committer | Muhammad Mominul Huque <[email protected]> | 2019-06-15 19:48:50 +0100 |
commit | 91510db6d8d89e8907a0cbf33e6068259b3bc88b (patch) | |
tree | 8c491ef6e810bd1fc4935ab027a10d6de76f0b51 /crates/ra_tools/src/bin | |
parent | 41c56c8a0d01d395e49cd199e6050b02a91cff1d (diff) |
Fall down of failures
Diffstat (limited to 'crates/ra_tools/src/bin')
-rw-r--r-- | crates/ra_tools/src/bin/pre-commit.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_tools/src/bin/pre-commit.rs b/crates/ra_tools/src/bin/pre-commit.rs index c514e992b..95bb55cae 100644 --- a/crates/ra_tools/src/bin/pre-commit.rs +++ b/crates/ra_tools/src/bin/pre-commit.rs | |||
@@ -1,7 +1,5 @@ | |||
1 | use std::process::Command; | 1 | use std::process::Command; |
2 | 2 | ||
3 | use failure::bail; | ||
4 | |||
5 | use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite}; | 3 | use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite}; |
6 | 4 | ||
7 | fn main() -> Result<()> { | 5 | fn main() -> Result<()> { |
@@ -19,7 +17,10 @@ fn update_staged() -> Result<()> { | |||
19 | .current_dir(&root) | 17 | .current_dir(&root) |
20 | .output()?; | 18 | .output()?; |
21 | if !output.status.success() { | 19 | if !output.status.success() { |
22 | bail!("`git diff --diff-filter=MAR --name-only --cached` exited with {}", output.status); | 20 | Err(format!( |
21 | "`git diff --diff-filter=MAR --name-only --cached` exited with {}", | ||
22 | output.status | ||
23 | ))?; | ||
23 | } | 24 | } |
24 | for line in String::from_utf8(output.stdout)?.lines() { | 25 | for line in String::from_utf8(output.stdout)?.lines() { |
25 | run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?; | 26 | run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?; |