From b674eb8053c34ec38543e77f22e71a56216cbd8b Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 4 Jul 2017 15:32:13 +0200 Subject: [PATCH] generic_git: allow passing workdir to git() Signed-off-by: Tobias Ulmer --- generic/generic_git.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) -- 2.39.5