From 096f17cf1bcf46529144229f70c9f88ed264a798 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 1 Mar 2019 17:24:00 +0100 Subject: [PATCH] generic_git: use arg instead of reinventing the wheel Signed-off-by: Tobias Ulmer --- generic/generic_git.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/generic/generic_git.lua b/generic/generic_git.lua index 8f23ca5..a777823 100644 --- a/generic/generic_git.lua +++ b/generic/generic_git.lua @@ -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. -- 2.39.5