From 44ea23c1b58cece1d6aa8b463e450282f8040e6d Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Mon, 20 Aug 2018 20:01:51 +0200 Subject: [PATCH] Update --- src/symbols/factory.rs | 2 +- src/symbols/git/checkout.rs | 5 +++-- src/symbols/hook.rs | 1 + src/symbols/owner.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/symbols/factory.rs b/src/symbols/factory.rs index 2cb7143..1b7dd5f 100644 --- a/src/symbols/factory.rs +++ b/src/symbols/factory.rs @@ -54,7 +54,7 @@ impl<'b, C: 'b + CommandRunner, R: 'b + SymbolRunner> SymbolFactory<'b, C, R> { )).into_action(self.symbol_runner) } - fn get_php_fpm_pool_socket_path<'a>(&'a self, user_name: &'static str) -> String { + pub fn get_php_fpm_pool_socket_path<'a>(&'a self, user_name: &'static str) -> String { format!("/run/php/{}.sock", user_name) } diff --git a/src/symbols/git/checkout.rs b/src/symbols/git/checkout.rs index 548c456..0e401c2 100644 --- a/src/symbols/git/checkout.rs +++ b/src/symbols/git/checkout.rs @@ -51,8 +51,9 @@ impl<'a, C: CommandRunner> Symbol for GitCheckout<'a, C> { }; } try!(self._run_in_target_repo(&["fetch", self.source, self.branch])); - let fetch_head = try!(self._run_in_target_repo(&["rev-parse", "FETCH_HEAD"])); - let head = try!(self._run_in_target_repo(&["rev-parse", "HEAD"])); + // git rev-list resolves tag objects + let fetch_head = try!(self._run_in_target_repo(&["rev-list", "-1", "FETCH_HEAD"])); + let head = try!(self._run_in_target_repo(&["rev-list", "-1", "HEAD"])); Ok(fetch_head == head) } diff --git a/src/symbols/hook.rs b/src/symbols/hook.rs index 8147242..149f522 100644 --- a/src/symbols/hook.rs +++ b/src/symbols/hook.rs @@ -9,6 +9,7 @@ pub struct Hook where A: Symbol, B: Symbol { b: B } +// A and B are executed if either A or B are not reached impl Hook where A: Symbol, B: Symbol { pub fn new(a: A, b: B) -> Self { Hook { a: a, b: b } diff --git a/src/symbols/owner.rs b/src/symbols/owner.rs index f27459a..5b9f12c 100644 --- a/src/symbols/owner.rs +++ b/src/symbols/owner.rs @@ -34,7 +34,7 @@ impl<'a, C: CommandRunner, D> Symbol for Owner<'a, C, D> where D: AsRef + f } fn execute(&self) -> Result<(), Box> { - self.command_runner.run_successfully("chown", &[self.user_name.borrow(), self.path.as_ref()]) + self.command_runner.run_successfully("chown", &["-R", self.user_name.borrow(), self.path.as_ref()]) } fn get_prerequisites(&self) -> Vec {