feat: add expand_dir opts for git_status (#591)

* feat: add expand_dir opts for git_status

* make -u as the default
This commit is contained in:
elianiva
2021-03-02 19:41:01 +07:00
committed by GitHub
parent 763f63eb14
commit 569ebd43e7

View File

@@ -127,7 +127,14 @@ end
git.status = function(opts)
local gen_new_finder = function()
local output = utils.get_os_command_output({ 'git', 'status', '-s', '--', '.' }, opts.cwd)
local expand_dir = utils.if_nil(opts.expand_dir, true, opts.expand_dir)
local git_cmd = {'git', 'status', '-s', '--', '.'}
if expand_dir then
table.insert(git_cmd, table.getn(git_cmd) - 1, '-u')
end
local output = utils.get_os_command_output(git_cmd, opts.cwd)
if table.getn(output) == 0 then
print('No changes found')