1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-02 06:40:55 +01:00

25521: get merge strategies from git merge in case the administrator has added custom strategies.

This commit is contained in:
Clint Adams 2008-08-24 19:48:09 +00:00
parent 9fe735e663
commit 9d7298bac8
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2008-08-24 Clint Adams <clint@zsh.org>
* 25521: Completion/Unix/Command/_git: get merge strategies from
git merge in case the administrator has added custom strategies.
2008-08-22 Peter Stephenson <pws@csr.com>
* 25508: Src/exec.c: set file name if function came from

View file

@ -4039,12 +4039,14 @@ __git_gpg_secret_keys () {
(( $+functions[__git_merge_strategies] )) ||
__git_merge_strategies () {
declare -a merge_strategies_cache
merge_strategies_cache=(${${=${${(M)${(f)"$(<$(git --exec-path)/git-merge)"}:#all_strategies*}##all_strategies=\'}%%\'}:#recur})
local expl
_wanted merge-strategies expl 'merge strategy' compadd - $merge_strategies_cache
local -a merge_strategies
if ! merge_strategies=(${=${${(M)${(f)"$(_call_program strategies git merge -s '' 2>&1)"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}); then
merge_strategies=(${=${${(M)${(f)"$(<$(git --exec-path)/git-merge)"}:#all_strategies*}##all_strategies=\'}%%\'})
fi
_wanted merge-strategies expl 'merge strategy' compadd -a merge_strategies "$@"
}
# TODO: Use this in more places.