Only do git status -u if status.showUntrackedFiles = true
Some git use cases, specifically where $HOME is a git worktree with a bare git repo somewhere else, really get bogged down if you do `git status -u`. This overcomes that issue.
This commit is contained in:
@@ -6,7 +6,11 @@ local roots = {}
|
|||||||
local not_git = 'not a git repo'
|
local not_git = 'not a git repo'
|
||||||
|
|
||||||
local function update_root_status(root)
|
local function update_root_status(root)
|
||||||
local status = vim.fn.systemlist('cd "'..root..'" && git status --porcelain=v1 -u')
|
local untracked = ' -u'
|
||||||
|
if vim.fn.trim(vim.fn.system('git config --type=bool status.showUntrackedFiles')) == 'false' then
|
||||||
|
untracked = ''
|
||||||
|
end
|
||||||
|
local status = vim.fn.systemlist('cd "'..root..'" && git status --porcelain=v1'..untracked)
|
||||||
roots[root] = {}
|
roots[root] = {}
|
||||||
|
|
||||||
for _, v in pairs(status) do
|
for _, v in pairs(status) do
|
||||||
|
|||||||
Reference in New Issue
Block a user