Remove execute legacy

This commit is contained in:
Roey Darwish Dror
2019-03-10 21:48:49 +02:00
parent 12bf4a51f9
commit 1095f46a8a
7 changed files with 86 additions and 135 deletions

View File

@@ -55,25 +55,18 @@ impl Git {
None
}
pub fn pull<P: AsRef<Path>>(&self, path: P, run_type: RunType) -> Option<(String, bool)> {
pub fn pull<P: AsRef<Path>>(&self, path: P, run_type: RunType) -> Result<(), Error> {
let path = path.as_ref();
print_separator(format!("Pulling {}", HumanizedPath::from(path)));
let git = self.git.as_ref().unwrap();
let success = || -> Result<(), Error> {
run_type
.execute(git)
.args(&["pull", "--rebase", "--autostash"])
.current_dir(&path)
.check_run()?;
Ok(())
}()
.is_ok();
Some((format!("git: {}", HumanizedPath::from(path)), success))
run_type
.execute(git)
.args(&["pull", "--rebase", "--autostash"])
.current_dir(&path)
.check_run()
}
}