diff options
| author | elianiva <dicha.arkana03@gmail.com> | 2021-03-02 19:41:01 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-02 19:41:01 +0700 |
| commit | 569ebd43e7c8b2fcbadf03751e05526ab39fdf77 (patch) | |
| tree | 1cc972eb014d516977478ddaf46f02bf94756c1b /lua | |
| parent | 763f63eb14fc31dac5b5e15ad4bde1adb12f7c39 (diff) | |
feat: add expand_dir opts for git_status (#591)
* feat: add expand_dir opts for git_status
* make -u as the default
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin/git.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lua/telescope/builtin/git.lua b/lua/telescope/builtin/git.lua index 98551ca..f120655 100644 --- a/lua/telescope/builtin/git.lua +++ b/lua/telescope/builtin/git.lua @@ -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') |
