aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_tools/src/bin
diff options
context:
space:
mode:
authorMuhammad Mominul Huque <[email protected]>2019-06-15 19:48:50 +0100
committerMuhammad Mominul Huque <[email protected]>2019-06-15 19:48:50 +0100
commit91510db6d8d89e8907a0cbf33e6068259b3bc88b (patch)
tree8c491ef6e810bd1fc4935ab027a10d6de76f0b51 /crates/ra_tools/src/bin
parent41c56c8a0d01d395e49cd199e6050b02a91cff1d (diff)
Fall down of failures
Diffstat (limited to 'crates/ra_tools/src/bin')
-rw-r--r--crates/ra_tools/src/bin/pre-commit.rs7
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 @@
1use std::process::Command; 1use std::process::Command;
2 2
3use failure::bail;
4
5use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite}; 3use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite};
6 4
7fn main() -> Result<()> { 5fn 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()), ".")?;