summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2015-05-13 15:24:28 +0200
committerDaniel Hahler <git@thequod.de>2015-05-18 02:48:03 +0200
commit454f079852deb0c704870c7d5a462485f1e65bbf (patch)
tree562f4f1d278b5fd5e9badff1100b3c1f0ad02b30 /Completion/Unix/Command
parent1d5b2254988ceeca2a2a04db2e77733f265afbd2 (diff)
downloadzsh-454f079852deb0c704870c7d5a462485f1e65bbf.tar.gz
zsh-454f079852deb0c704870c7d5a462485f1e65bbf.tar.xz
zsh-454f079852deb0c704870c7d5a462485f1e65bbf.zip
35101: completion: git: add __git_commit_objects_prefer_recent
This is used with __git_commits then, and is meant to only call
__git_recent_commits, if there are matches.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_git7
1 files changed, 6 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 92835387d..d64e777e8 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5600,6 +5600,11 @@ __git_remote_branch_names_noprefix () {
   _wanted remote-branch-names-noprefix expl 'remote branch name' compadd "$@" -a - branch_names
 }
 
+(( $+functions[__git_commit_objects_prefer_recent] )) ||
+__git_commit_objects_prefer_recent () {
+  __git_recent_commits || __git_commit_objects
+}
+
 (( $+functions[__git_commits] )) ||
 __git_commits () {
   # TODO: deal with things that __git_heads and __git_tags has in common (i.e.,
@@ -5610,7 +5615,7 @@ __git_commits () {
   _alternative \
     "heads::__git_heads $sopts" \
     "commit-tags::__git_commit_tags $sopts" \
-    'commit-objects::__git_commit_objects'
+    'commit-objects::__git_commit_objects_prefer_recent'
 }
 
 (( $+functions[__git_heads] )) ||