about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2018-06-18 09:19:26 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-06-18 09:19:26 +0200
commit4dddf3aa6e446cef6e0ea720aa20bcf71d6107b1 (patch)
tree71abb3b3b5d3383ee81eee33312d7443bc424b48
parent810b5c8ab99340fc0cf4c224697d1d069ab3d90b (diff)
downloadzsh-4dddf3aa6e446cef6e0ea720aa20bcf71d6107b1.tar.gz
zsh-4dddf3aa6e446cef6e0ea720aa20bcf71d6107b1.tar.xz
zsh-4dddf3aa6e446cef6e0ea720aa20bcf71d6107b1.zip
users/23484: be consistent on matcher specs for git branches to fix issue with partial matching
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git12
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6956e569b..88b9aa6e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2018-06-18  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
+	* users/23484: Completion/Unix/Command/_git: be consistent on
+	matcher specs for branches to fix issue with partial matching
+
 	* 43048: Eitan: Completion/Unix/Command/_gcc: add sanitizers,
 	standards aliases and fix -flto
 
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] )) ||