summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 568a3b7c1..88376c078 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-19  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* users/20222: Completion/Unix/Command/_git: users/20222:
+	completion: git: Add matchspec for heads
+
 2015-05-18  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 35193: Doc/Zsh/builtins.yo, Src/builtin.c, Src/hashtable.h,
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 708eb2a06..a40ebe988 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5586,7 +5586,7 @@ __git_remote_branch_names () {
   branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/})
   __git_command_successful $pipestatus || return 1
 
-  _wanted remote-branch-names expl 'remote branch name' compadd "$@" -a - branch_names
+  _wanted remote-branch-names expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names
 }
 
 (( $+functions[__git_remote_branch_names_noprefix] )) ||
@@ -5597,7 +5597,7 @@ __git_remote_branch_names_noprefix () {
   branch_names=(${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}##*/}:#HEAD})
   __git_command_successful $pipestatus || return 1
 
-  _wanted remote-branch-names-noprefix expl 'remote branch name' compadd "$@" -a - branch_names
+  _wanted remote-branch-names-noprefix expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names
 }
 
 (( $+functions[__git_commit_objects_prefer_recent] )) ||
@@ -5638,7 +5638,7 @@ __git_heads_local () {
     [[ -f $gitdir/refs/stash ]] && heads+=stash
   fi
 
-  _wanted heads-local expl "local head" compadd "$@" -a - heads
+  _wanted heads-local expl "local head" compadd -M 'r:|/=**' "$@" -a - heads
 }
 
 (( $+functions[__git_heads_remote] )) ||
@@ -5648,7 +5648,7 @@ __git_heads_remote () {
 
   heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)" refs/remotes' 2>/dev/null)"})
 
-  _wanted heads-remote expl "remote head" compadd "$@" -a - heads
+  _wanted heads-remote expl "remote head" compadd -M 'r:|/=**' "$@" -a - heads
 }
 
 (( $+functions[__git_commit_objects] )) ||