]> git.e2factory.org Git - e2factory.git/commitdiff
generic_git: use arg instead of reinventing the wheel
authorTobias Ulmer <tu@emlix.com>
Fri, 1 Mar 2019 16:24:00 +0000 (17:24 +0100)
committerTobias Ulmer <tu@emlix.com>
Fri, 1 Mar 2019 16:24:00 +0000 (17:24 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/generic_git.lua

index 8f23ca50f7665f510bac2b46671950eb59117b4b..a777823d7cd454475244335717f6bfca90410314 100644 (file)
@@ -140,8 +140,6 @@ end
 -- @param ... Further arguments are added to the end of the argument vector.
 -- @return Argument vector table.
 function generic_git.git_new_argv(git_dir, work_tree, ...)
-    local argv = {...}
-
     if git_dir == nil and work_tree then
         git_dir = e2lib.join(work_tree, ".git")
     end
@@ -150,13 +148,13 @@ function generic_git.git_new_argv(git_dir, work_tree, ...)
     end
 
     if work_tree then
-        table.insert(argv, 1, "--work-tree="..work_tree)
+        table.insert(arg, 1, "--work-tree="..work_tree)
     end
     if git_dir then
-        table.insert(argv, 1, "--git-dir="..git_dir)
+        table.insert(arg, 1, "--git-dir="..git_dir)
     end
 
-    return argv
+    return arg
 end
 
 --- Call out to git.