zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH 1/2] _git: Break out a helper function.
Date: Tue, 11 Sep 2018 13:24:20 +0000	[thread overview]
Message-ID: <20180911132421.13932-1-danielsh@tarpaulin.shahaf.local2> (raw)

---
 Completion/Unix/Command/_git | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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 $*

             reply	other threads:[~2018-09-11 13:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 13:24 Daniel Shahaf [this message]
2018-09-11 13:24 ` [PATCH 2/2] _git: When completing worktrees, show the ref and hash of each worktree Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180911132421.13932-1-danielsh@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).