From: Tobias Ulmer Date: Tue, 4 Jul 2017 13:32:13 +0000 (+0200) Subject: generic_git: allow passing workdir to git() X-Git-Tag: e2factory-2.3.18rc1~112 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=b674eb8053c34ec38543e77f22e71a56216cbd8b;p=e2factory.git generic_git: allow passing workdir to git() Signed-off-by: Tobias Ulmer --- diff --git a/generic/generic_git.lua b/generic/generic_git.lua index 8d87a9b..ea3fef1 100644 --- a/generic/generic_git.lua +++ b/generic/generic_git.lua @@ -114,10 +114,11 @@ end --- Call out to git. -- @param argv Array of arguments to git. +-- @param workdir Working directory of tool (optional). -- @return True on success, false on error. -- @return Error object on failure. -- @return Any captured git output or the empty string if nothing was captured. -function generic_git.git(argv) +function generic_git.git(argv, workdir) local rc, re, e, git, fifo, out git, re = tools.get_tool_flags_argv("git") @@ -147,7 +148,7 @@ function generic_git.git(argv) table.insert(out, msg) end - rc, re = e2lib.callcmd_capture(git, capture) + rc, re = e2lib.callcmd_capture(git, capture, workdir) if not rc then e = err.new("git command %q failed", table.concat(git, " ")) return false, e:cat(re), table.concat(out)