diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2014-01-27 21:54:13 -0800 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2014-01-27 21:54:13 -0800 |
commit | a2098b0b26b47917cc725b387c63d75dfe0098f2 (patch) | |
tree | fa3b9bdc1c9ec40fc89042766f0a7932eb7d1f0c | |
parent | a0c9da72f2625ac79648add48262532ddff2166d (diff) | |
download | zsh-a2098b0b26b47917cc725b387c63d75dfe0098f2.tar.gz zsh-a2098b0b26b47917cc725b387c63d75dfe0098f2.tar.xz zsh-a2098b0b26b47917cc725b387c63d75dfe0098f2.zip |
users/18368: compromise to restore partial path completion inadvertently removed by 31159
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 6cb62c8ec..fdffb7cba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-01-27 Barton E. Schaefer <schaefer@zsh.org> + + * users/18368: Completion/Unix/Command/_git: in __git_files, + retry ls-files if nothing matched the prefix pattern, to give + _multi_parts a shot at the whole file list. Restores partial + path completion inadvertently removed by 31159. + 2014-01-27 Peter Stephenson <p.stephenson@samsung.com> * unposted: Src/zsh.mdd: update 31983 to suppress stdout from @@ -5,7 +12,7 @@ 2014-01-23 Bart Schaefer <schaefer@zsh.org> - * unposted: Doc/Zsh/arith.yo: use LPAR() instead of parens + * unposted: Doc/Zsh/arith.yo: use LPAR()+RPAR() instead of parens in sqrt example 2014-01-23 Peter Stephenson <p.stephenson@samsung.com> diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 43a01d9ff..c09f2555a 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5683,9 +5683,17 @@ __git_files () { # TODO: --directory should probably be added to $opts when --others is given. 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 $opts -- ${pref:+$pref\\\*} 2>/dev/null)"}) __git_command_successful $pipestatus || return + # If ls-files succeeded but returned nothing, try again with no pattern + if [[ -z "$files" && -n "$pref" ]]; then + files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- 2>/dev/null)"}) + __git_command_successful $pipestatus || return + fi + # _wanted $tag expl $description _files -g '{'${(j:,:)files}'}' $compadd_opts - _wanted $tag expl $description _multi_parts -f $compadd_opts - / files } |