From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19851 invoked by alias); 28 Jul 2013 16:23:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31607 Received: (qmail 7337 invoked from network); 28 Jul 2013 16:23:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.215.49 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=pKv3x3MLXz4WfgGicAahscAPGXW3aJ8bUcHHg/dQkjE=; b=SQEL17uqpp6E+fczbBaGSrKvC8Nb/gicZQJUOnj6QMre/dZyjSMBArAfdAGQ5Ldwps WLzQTYFBDVayDE35polRQzOuA2kQuGF9PafcICPfJ+jYgFBXr5wJHSy1KSEJ2FaDpuW9 HP5q/woFScC7aM9cveFn4ACJH8+DqMEgemUwT62jen5G2qcmpIBmzvju9QG6ykQ/7xXC CD+FPIxAj/asdzFUJN7EOpx1UfO9MoGLlT3xPDx6vGiuOsD3m4GIFuA3VzMr2e15yaC9 31HXxlPDXHewYKJxuMhFj5Klz9AFmXHfeLCIjEq13NFyIw+84Ymz2gM9LXRd+XrBXiRa G5mw== X-Received: by 10.152.2.226 with SMTP id 2mr206317lax.14.1375028591515; Sun, 28 Jul 2013 09:23:11 -0700 (PDT) From: =?UTF-8?q?=C3=98ystein=20Walle?= To: zsh-workers@zsh.org Cc: m0viefreak.cm@googlemail.com Subject: [PATCH 15/16] _git: git rm: make git rm --cached work as intended Date: Sun, 28 Jul 2013 18:22:12 +0200 Message-Id: <3debebad8c56f7f8ad681b7c0b4d226e33e5e011.1375006129.git.oystwa@gmail.com> X-Mailer: git-send-email 1.8.2.2 In-Reply-To: References: In-Reply-To: References: From: m0viefreak While limiting the completion to __git_changed-in-index_files makes perfect sense for "git diff", it is wrong to use for "git rm", because it prevents it from completing files present in HEAD. Giving --cached to git rm is supposed to "just remove it from the index, keep the working tree copy" and is in no way related to the file needing to be modified in the index in the first place. --- Completion/Unix/Command/_git | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 9b15d57..9f133f9 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1342,11 +1342,7 @@ _git-rm () { case $state in (file) - if [[ -n ${opt_args[(I)--cached]} ]]; then - __git_changed-in-index_files && ret=0 - else - __git_cached_files && ret=0 - fi + __git_cached_files && ret=0 ;; esac -- 1.8.2.2