Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing the call to vim.fn.system #1550

Merged
merged 3 commits into from
Sep 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lua/nvim-tree/git/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down