diff options
| author | Oliver Kiddle <opk@zsh.org> | 2014-10-14 23:03:40 +0200 |
|---|---|---|
| committer | Oliver Kiddle <opk@zsh.org> | 2014-10-14 23:04:45 +0200 |
| commit | 13fc579343b24d298fb8905933b6000d7fcda114 (patch) | |
| tree | cbc1000696357438714107635f93166bcab76d3a /Completion/Unix/Command/_git | |
| parent | 33459: test for variable substitution in variable splitting (diff) | |
| download | zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.gz zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.bz2 zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.lz zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.xz zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.zst zsh-13fc579343b24d298fb8905933b6000d7fcda114.zip | |
33467: correct return status on functions and numerous other minor fixes
Diffstat (limited to 'Completion/Unix/Command/_git')
| -rw-r--r-- | Completion/Unix/Command/_git | 89 |
1 files changed, 36 insertions, 53 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index c4e386b15..38bd72979 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5262,12 +5262,10 @@ __git_gpg_secret_keys () { (( $+functions[__git_merge_strategies] )) || __git_merge_strategies () { local expl - local -a merge_strategies - merge_strategies=(${=${${(M)${(f)"$(_call_program merge-strategies "git merge -s '' 2>&1")"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}) - __git_command_successful $pipestatus || return 1 - - _wanted merge-strategies expl 'merge strategy' compadd $* - $merge_strategies + _wanted merge-strategies expl 'merge strategy' compadd "$@" - \ + ${=${${${(M)${(f)"$(_call_program merge-strategies \ + "git merge -s '' 2>&1")"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}:-octopus ours recursive resolve subtree} } (( $+functions[__git_encodings] )) || @@ -5299,8 +5297,9 @@ __git_remotes () { local remotes expl remotes=(${(f)"$(_call_program remotes git remote 2>/dev/null)"}) + __git_command_successful $pipestatus || return 1 - _wanted remotes expl remote compadd $* - $remotes + _wanted remotes expl remote compadd "$@" -a - remotes } (( $+functions[__git_ref_specs] )) || @@ -5431,13 +5430,7 @@ __git_reflog_entries () { reflog_entries=(${${${(f)"$(_call_program reflog-entries git reflog 2>/dev/null)"}#* }%%:*}) __git_command_successful $pipestatus || return 1 - if compset -P '*@'; then - reflog_entries=(${${(M)reflog_entries:#$IPREFIX*}#$IPREFIX}) - _wanted reflog-entries expl 'reflog entry' compadd $* - $reflog_entries - else - reflog_entries=(${reflog_entries%@*}) - _wanted reflog-entries expl 'reflog entry' compadd -qS @ $* - $reflog_entries - fi + _wanted reflog-entries expl 'reflog entry' _multi_parts @ reflog_entries } (( $+functions[__git_ref_sort_keys] )) || @@ -5492,7 +5485,7 @@ __git_stashes () { stashes=(${${(f)"$(_call_program stashes git stash list 2>/dev/null)"}/: */}) __git_command_successful $pipestatus || return 1 - _wanted stashes expl stash compadd $* - $stashes + _wanted stashes expl stash compadd "$@" -a - stashes } (( $+functions[__git_svn_revisions] )) || @@ -5531,7 +5524,7 @@ __git_branch_names () { branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) __git_command_successful $pipestatus || return 1 - _wanted branch-names expl branch-name compadd $* - $branch_names + _wanted branch-names expl branch-name compadd "$@" -a - branch_names } (( $+functions[__git_remote_branch_names] )) || @@ -5542,7 +5535,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 $* - $branch_names + _wanted remote-branch-names expl 'remote branch name' compadd "$@" -a - branch_names } (( $+functions[__git_remote_branch_names_noprefix] )) || @@ -5553,7 +5546,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 $* - $branch_names + _wanted remote-branch-names-noprefix expl 'remote branch name' compadd "$@" -a - branch_names } (( $+functions[__git_commits] )) || @@ -5582,7 +5575,7 @@ __git_heads () { done fi - _wanted heads expl head compadd $* - $heads + _wanted heads expl head compadd "$@" -a - heads } (( $+functions[__git_commit_objects] )) || @@ -5678,7 +5671,7 @@ __git_submodules () { submodules=(${${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#?* }%% *}) __git_command_successful $pipestatus || return 1 - _wanted submodules expl submodule compadd $* - $submodules + _wanted submodules expl submodule compadd "$@" -a - submodules } # Tag Argument Types @@ -5691,7 +5684,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 $* - $tags + _wanted tags expl tag compadd "$@" -a - tags } (( $+functions[__git_commit_tags] )) || @@ -5714,7 +5707,7 @@ __git_tags_of_type () { tags=(${${(M)${(f)"$(_call_program $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 |
