zsh-workers
 help / color / mirror / code / Atom feed
From: Nikolai Weibull <now@bitwi.se>
To: zsh-workers@zsh.org
Cc: Nikolai Weibull <now@bitwi.se>
Subject: [PATCH 3/4] Fix git-branch -[dD] -r completion
Date: Fri, 18 Mar 2011 22:35:11 +0100	[thread overview]
Message-ID: <1300484112-9392-4-git-send-email-now@bitwi.se> (raw)
In-Reply-To: <1300484112-9392-1-git-send-email-now@bitwi.se>

Signed-off-by: Nikolai Weibull <now@bitwi.se>
---
 Completion/Unix/Command/_git |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8a590be..0f573a1 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -266,8 +266,12 @@ _git-branch () {
   if (( words[(I)-d] || words[(I)-D] )); then
     dependent_creation_args=
     dependent_deletion_args=(
-      '-r[delete remote-tracking branches]'
-      '*: :__git_ignore_line_inside_arguments __git_branch_names')
+      '-r[delete remote-tracking branches]')
+    if (( words[(I)-r] )); then
+      dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_remote_branch_names'
+    else
+      dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_branch_names'
+    fi
   fi
 
   declare -a dependent_modification_args
@@ -4913,7 +4917,7 @@ __git_remote_branch_names () {
   local expl
   declare -a branch_names
 
-  branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='%(refname)' refs/remotes 2>/dev/null)"}#refs/remotes/})
+  branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/})
   __git_command_successful $pipestatus || return
 
   _wanted remote-branch-names expl 'remote branch name' compadd $* - $branch_names
-- 
1.7.4.1


  parent reply	other threads:[~2011-03-18 22:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 21:35 Small patches o git completion Nikolai Weibull
2011-03-18 21:35 ` [PATCH 1/4] Fix typo Nikolai Weibull
2011-03-18 21:35 ` [PATCH 2/4] Only show modified files for git-checkout without tree Nikolai Weibull
2011-03-18 21:35 ` Nikolai Weibull [this message]
2011-03-18 22:26   ` [PATCH 3/4] Fix git-branch -[dD] -r completion Frank Terbeck
2011-03-19  2:55     ` Benjamin R. Haskell
2011-03-19  8:21       ` Frank Terbeck
2011-03-19  9:10     ` Nikolai Weibull
2011-03-19  9:29       ` Frank Terbeck
2011-03-19 13:19       ` Benjamin R. Haskell
2011-05-29 15:10         ` Nikolai Weibull
2011-03-18 21:35 ` [PATCH 4/4] Fix typo in git-send-email completion Nikolai Weibull
2011-03-18 22:43 ` Small patches o git completion Frank Terbeck
2011-03-19 22:15 ` Simon Ruderich
2011-04-15 14:08   ` Simon Ruderich
2011-04-15 14:24     ` Nikolai Weibull
2011-04-15 14:37       ` Mikael Magnusson
2011-04-15 14:44         ` Nikolai Weibull
2011-04-15 14:49           ` Mikael Magnusson
2011-05-02  8:16             ` [PATCH] Fix -l option for git-tag completion Nikolai Weibull
2011-05-12 16:02               ` Mikael Magnusson
2011-04-15 14:45     ` Small patches o git completion Frank Terbeck

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=1300484112-9392-4-git-send-email-now@bitwi.se \
    --to=now@bitwi.se \
    --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).