1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 05:00:59 +01:00

40818: _git-checkout: When completing local heads, prefer recently-checked-out ones. (after 38592)

This commit is contained in:
Daniel Shahaf 2017-03-10 09:05:17 +00:00
parent 46233c4020
commit e869952200
2 changed files with 9 additions and 1 deletions

View file

@ -1,5 +1,9 @@
2017-03-14 Daniel Shahaf <d.s@daniel.shahaf.name> 2017-03-14 Daniel Shahaf <d.s@daniel.shahaf.name>
* 40818: Completion/Unix/Command/_git: _git-checkout: When
completing local heads, prefer recently-checked-out ones. (after
38592)
* 40817: Completion/Unix/Command/_git: __git_recent_branches: * 40817: Completion/Unix/Command/_git: __git_recent_branches:
Retrieve less data, but faster. Retrieve less data, but faster.

View file

@ -476,7 +476,7 @@ _git-checkout () {
# TODO: Allow A...B # TODO: Allow A...B
local \ local \
remote_branch_noprefix_arg='remote-branch-names-noprefix::__git_remote_branch_names_noprefix' \ remote_branch_noprefix_arg='remote-branch-names-noprefix::__git_remote_branch_names_noprefix' \
tree_ish_arg='tree-ishs::__git_tree_ishs' \ tree_ish_arg='tree-ishs::__git_commits_prefer_recent' \
file_arg='modified-files::__git_modified_files' file_arg='modified-files::__git_modified_files'
if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then
@ -6169,6 +6169,10 @@ __git_recent_branches() {
_describe -V -t recent-branches "recent branches" branches_colon_descriptions _describe -V -t recent-branches "recent branches" branches_colon_descriptions
} }
(( $+functions[__git_commits_prefer_recent] )) ||
__git_commits_prefer_recent () {
_alternative 'recent-branches::__git_recent_branches' 'commits::__git_commits'
}
(( $+functions[__git_commits] )) || (( $+functions[__git_commits] )) ||
__git_commits () { __git_commits () {