about summary refs log tree commit diff
path: root/Completion/Unix/Command/_git
diff options
context:
space:
mode:
authorm0viefreak <m0viefreak.cm@googlemail.com>2013-09-22 12:48:28 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2013-09-22 14:01:16 +0200
commit8a70a985777031857eb02366a3115e8f6e1f024f (patch)
treef3fdf960836bf91dc03ce2184c534901b6f34e5e /Completion/Unix/Command/_git
parent2025b05bcfc935becf0dea46054b63d191685d3b (diff)
downloadzsh-8a70a985777031857eb02366a3115e8f6e1f024f.tar.gz
zsh-8a70a985777031857eb02366a3115e8f6e1f024f.tar.xz
zsh-8a70a985777031857eb02366a3115e8f6e1f024f.zip
31754: _git: git rm: make git rm --cached work as intended
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.
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r--Completion/Unix/Command/_git6
1 files changed, 1 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2dc9ed2cc..d6f44e679 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