From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4233 invoked by alias); 22 Sep 2013 10:49: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: 31754 Received: (qmail 19014 invoked from network); 22 Sep 2013 10:49:02 -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.48 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:in-reply-to:references :in-reply-to:references; bh=yQEDmeNyMD+vCfDVhCza9n3dXLE6tvslmyKCdZW9A14=; b=byWp+jRcrEwCVTPwl0NwqZDk1LZj4VMBAdbjTtyPz9vZjxOKvT82UtOMVXVZRplxwg /I0tJXbcCJg1VF4FliGzI12XEgR3MLWEUa+ee6fNPxeYSFzaMdLCHMe8xXaZZoDaq2XJ 2GLdKKB05CEnlGsUIT8c7jg6/5M7Le32J9Mu/Mzb8uApn/U8YBk6pdxEFyrey92U5eF3 cHxKSNl4Mly5Gkxjp5lgwAhK6VqoaxmRskSrvc6rN+oIGIsXXOI2Y+MD7o29YoFWQ6XS GxCQuIpgzsqD/S3JOy6IxkczjTyGIv+pKDuntTRfFS8S3TPxXXI5UjMwaMGerpr0kOCc Eepg== X-Received: by 10.112.168.35 with SMTP id zt3mr14702734lbb.11.1379846937363; Sun, 22 Sep 2013 03:48:57 -0700 (PDT) From: =?UTF-8?q?=C3=98ystein=20Walle?= To: zsh-workers@zsh.org Cc: m0viefreak Subject: [PATCH v2 14/14] _git: git rm: make git rm --cached work as intended Date: Sun, 22 Sep 2013 12:48:28 +0200 Message-Id: <10f9d00049b2234dfce3ee2b3d442e97c9116cd5.1379846744.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 2dc9ed2..d6f44e6 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1344,11 +1344,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