Skip to content

Commit 2b2576c

Browse files
committed
Fix Git detection in filemanager.lua (thanks to humannum14916)
1 parent 056c380 commit 2b2576c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

filemanager-plugin/filemanager.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ end
7272
local function get_ignored_files(tar_dir)
7373
-- True/false if the target dir returns a non-fatal error when checked with 'git status'
7474
local function has_git()
75-
local git_rp_results = shell.ExecCommand('git -C "' .. tar_dir .. '" rev-parse --is-inside-work-tree')
75+
local git_rp_results = shell.ExecCommand('git', '-C', tar_dir, 'rev-parse', '--is-inside-work-tree')
7676
return git_rp_results:match("^true%s*$")
7777
end
7878
local readout_results = {}
7979
-- TODO: Support more than just Git, such as Mercurial or SVN
8080
if has_git() then
8181
-- If the dir is a git dir, get all ignored in the dir
8282
local git_ls_results =
83-
shell.ExecCommand('git -C "' .. tar_dir .. '" ls-files . --ignored --exclude-standard --others --directory')
83+
shell.ExecCommand('git', '-C', tar_dir, 'ls-files', '.', '--ignored', '--exclude-standard', '--others', '--directory')
8484
-- Cut off the newline that is at the end of each result
8585
for split_results in string.gmatch(git_ls_results, "([^\r\n]+)") do
8686
-- git ls-files adds a trailing slash if it's a dir, so we remove it (if it is one)

0 commit comments

Comments
 (0)