From 7ae2be3a2fd7e3be2b6f3990cb4c0ca164cf72d1 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 11 Sep 2018 13:24:20 +0000 Subject: 43442: _git: Break out a helper function. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12189d37c..1f8d43329 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-09-12 Daniel Shahaf + + * 43442: Completion/Unix/Command/_git: Break out a helper + function. + 2018-09-12 Peter Stephenson * 43450: Src/signals.c: fix window size if reattaching shell diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 2cae4c82f..b2f93ff0f 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2108,8 +2108,7 @@ _git-worktree() { ;; esac if [[ $state = worktrees ]]; then - _wanted directories expl 'working tree' compadd -S ' ' -f -M 'r:|/=* r:|=*' \ - ${${(M)${(f)"$(_call_program directories git worktree list --porcelain)"}:#worktree*}#* } && ret=0 + __git_worktrees && ret=0 fi ;; esac @@ -7561,6 +7560,11 @@ __git_browsers () { 'builtin-browsers:builtin browser:compadd -a - builtinbrowsers' } +__git_worktrees () { + _wanted directories expl 'working tree' compadd -S ' ' -f -M 'r:|/=* r:|=*' \ + ${${(M)${(f)"$(_call_program directories git worktree list --porcelain)"}:#worktree*}#* } +} + (( $+functions[__git_difftools] )) || __git_difftools () { __git_diff-or-merge-tools diff $* -- cgit 1.4.1