More convenient run_with_output

This commit is contained in:
Aleksey Kladov 2020-02-10 15:16:07 +01:00
parent 33df947d62
commit 1b6acc391a
3 changed files with 16 additions and 19 deletions

View file

@ -14,7 +14,7 @@ pub fn run_hook() -> Result<()> {
let diff = run_with_output("git diff --diff-filter=MAR --name-only --cached", ".")?;
let root = project_root();
for line in String::from_utf8(diff.stdout)?.lines() {
for line in diff.lines() {
run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?;
}