]> git.e2factory.org Git - e2factory.git/commitdiff
generic_git: allow passing workdir to git()
authorTobias Ulmer <tu@emlix.com>
Tue, 4 Jul 2017 13:32:13 +0000 (15:32 +0200)
committerTobias Ulmer <tu@emlix.com>
Mon, 10 Dec 2018 17:00:11 +0000 (18:00 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/generic_git.lua

index 8d87a9b5efcba4deac04a44901a01549451148a6..ea3fef1479b7c0b2851e61b73039d6ff8cfeae15 100644 (file)
@@ -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)