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

[PATCH 1/1] fix file completion for git



From: Christian Hesse <mail@xxxxxxxx>

Starting with version 2.16.0 git does no longer accept empty string as a
pathspec element. Thus we have to replace empty strings with a dot.

Thanks to 'okdana' for help on irc.

https://github.com/git/git/commit/9e4e8a64c2b9043b7ae2b6476efd9214c6738505
Signed-off-by: Christian Hesse <mail@xxxxxxxx>
---
 Completion/Unix/Command/_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 80504c003..002709a5f 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6759,7 +6759,7 @@ __git_files () {
   local pref=$gitcdup$gitprefix$PREFIX
 
   # First allow ls-files to pattern-match in case of remote repository
-  files=(${(0)"$(_call_program files git ls-files -z --exclude-standard ${(q)opts} -- ${(q)${pref:+$pref\\\*}} 2>/dev/null)"})
+  files=(${(0)"$(_call_program files git ls-files -z --exclude-standard ${(q)opts} -- ${(q)${pref:+$pref\\\*}:-.} 2>/dev/null)"})
   __git_command_successful $pipestatus || return
 
   # If ls-files succeeded but returned nothing, try again with no pattern



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