fix(#1547): pass explicit system arguments to for git toplevel and untracked actions
* the nice fix * fix(#1547): pass git toplevel cwd unescaped, pass git untracked arguments as per toplevel Co-authored-by: Maximilian Philipp <philipp@student.tugraz.at> Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
52b0c32152
commit
9914780cba
@ -4,10 +4,11 @@ local log = require "nvim-tree.log"
|
||||
local has_cygpath = vim.fn.executable "cygpath" == 1
|
||||
|
||||
function M.get_toplevel(cwd)
|
||||
local cmd = "git -C " .. vim.fn.shellescape(cwd) .. " rev-parse --show-toplevel"
|
||||
|
||||
local ps = log.profile_start("git toplevel %s", cwd)
|
||||
log.line("git", cmd)
|
||||
|
||||
local cmd = { "git", "-C", cwd, "rev-parse", "--show-toplevel" }
|
||||
log.line("git", "%s", vim.inspect(cmd))
|
||||
|
||||
local toplevel = vim.fn.system(cmd)
|
||||
|
||||
@ -41,10 +42,10 @@ function M.should_show_untracked(cwd)
|
||||
return untracked[cwd]
|
||||
end
|
||||
|
||||
local cmd = "git -C " .. cwd .. " config status.showUntrackedFiles"
|
||||
|
||||
local ps = log.profile_start("git untracked %s", cwd)
|
||||
log.line("git", cmd)
|
||||
|
||||
local cmd = { "git", "-C", cwd, "config", "status.showUntrackedFiles" }
|
||||
log.line("git", vim.inspect(cmd))
|
||||
|
||||
local has_untracked = vim.fn.system(cmd)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user