From 4dddf3aa6e446cef6e0ea720aa20bcf71d6107b1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 18 Jun 2018 09:19:26 +0200 Subject: users/23484: be consistent on matcher specs for git branches to fix issue with partial matching --- Completion/Unix/Command/_git | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 21ba65724..254086473 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5615,7 +5615,7 @@ __git_describe_branch () { (( $+functions[__git_describe_commit] )) || __git_describe_commit () { - __git_describe_branch $1 $2 $3 -M 'r:|/=**' "${(@)argv[4,-1]}" + __git_describe_branch $1 $2 $3 -M 'r:|/=* r:|=*' "${(@)argv[4,-1]}" } # Completion Wrappers @@ -6532,7 +6532,7 @@ __git_recent_commits () { expl=() _wanted commit-tags expl 'commit tag' compadd "$@" -a - tags && ret=0 expl=() - _wanted heads expl 'head' compadd "$@" -a - heads && ret=0 + _wanted heads expl 'head' compadd -M "r:|/=* r:|=*" "$@" -a - heads && ret=0 return $ret } @@ -6657,7 +6657,7 @@ __git_tags () { tags=(${${(f)"$(_call_program tagrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/}) __git_command_successful $pipestatus || return 1 - _wanted tags expl tag compadd -M 'r:|/=**' "$@" -a - tags + _wanted tags expl tag compadd -M 'r:|/=* r:|=*' "$@" -a - tags } (( $+functions[__git_commit_tags] )) || @@ -6680,7 +6680,7 @@ __git_tags_of_type () { tags=(${${(M)${(f)"$(_call_program ${(q)type}-tag-refs "git for-each-ref --format='%(*objecttype)%(objecttype) %(refname)' refs/tags 2>/dev/null")"}:#$type(tag|) *}#$type(tag|) refs/tags/}) __git_command_successful $pipestatus || return 1 - _wanted $type-tags expl "$type tag" compadd -M 'r:|/=**' "$@" -a - tags + _wanted $type-tags expl "$type tag" compadd -M 'r:|/=* r:|=*' "$@" -a - tags } # Reference Argument Types @@ -6703,7 +6703,7 @@ __git_references () { _git_refs_cache_pwd=$PWD fi - _wanted references expl 'reference' compadd -M 'r:|/=**' -a - _git_refs_cache + _wanted references expl 'reference' compadd -M 'r:|/=* r:|=*' -a - _git_refs_cache } # ### currently unused; are some callers of __git_references supposed to call this function? @@ -6717,7 +6717,7 @@ __git_local_references () { _git_local_refs_cache_pwd=$PWD fi - _wanted references expl 'reference' compadd -M 'r:|/=**' -a - _git_local_refs_cache + _wanted references expl 'reference' compadd -M 'r:|/=* r:|=*' -a - _git_local_refs_cache } (( $+functions[__git_remote_references] )) || -- cgit 1.4.1