Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Make git-commit complete both modified files and git-added files.



On Thu, Oct 04, 2007 at 10:05:49AM +0200, Nikolai Weibull wrote:
> What do you need gitdir for?

He doesn't.

"files" is a pretty generic name for a tag.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.40
diff -u -r1.40 _git
--- Completion/Unix/Command/_git	4 Oct 2007 08:24:33 -0000	1.40
+++ Completion/Unix/Command/_git	4 Oct 2007 08:25:55 -0000
@@ -2627,8 +2627,7 @@
 #this is for git-commit which can take files both git-added and not
 (( $+functions[__git_changed_files] )) ||
 __git_changed_files () {
-  gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
-  __git_command_successful || return
+  local -a files
 
   files=(${(ps:\0:)"$(_call_program files git diff-index -z --name-only HEAD 2>/dev/null)"})
   __git_command_successful || return



Messages sorted by: Reverse Date, Date, Thread, Author