mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-23 20:45:21 -07:00
Compare commits
2 Commits
3fca9c8933
...
71ca38652b
Author | SHA1 | Date | |
---|---|---|---|
|
71ca38652b | ||
|
280c99dae6 |
@ -51,7 +51,7 @@ __gitex_remote_names() {
|
|||||||
local expl
|
local expl
|
||||||
declare -a remote_names
|
declare -a remote_names
|
||||||
remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
|
remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
|
||||||
__git_command_successful || return
|
__gitex_command_successful || return
|
||||||
_wanted remote-names expl remote-name compadd $* - $remote_names
|
_wanted remote-names expl remote-name compadd $* - $remote_names
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ __gitex_tag_names() {
|
|||||||
local expl
|
local expl
|
||||||
declare -a tag_names
|
declare -a tag_names
|
||||||
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
||||||
__git_command_successful || return
|
__gitex_command_successful || return
|
||||||
_wanted tag-names expl tag-name compadd $* - $tag_names
|
_wanted tag-names expl tag-name compadd $* - $tag_names
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ __gitex_branch_names() {
|
|||||||
local expl
|
local expl
|
||||||
declare -a branch_names
|
declare -a branch_names
|
||||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||||
__git_command_successful || return
|
__gitex_command_successful || return
|
||||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ __gitex_specific_branch_names() {
|
|||||||
local expl
|
local expl
|
||||||
declare -a branch_names
|
declare -a branch_names
|
||||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
|
||||||
__git_command_successful || return
|
__gitex_command_successful || return
|
||||||
_wanted branch-names expl branch-name compadd - $branch_names
|
_wanted branch-names expl branch-name compadd - $branch_names
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ __gitex_submodule_names() {
|
|||||||
local expl
|
local expl
|
||||||
declare -a submodule_names
|
declare -a submodule_names
|
||||||
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) # '
|
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) # '
|
||||||
__git_command_successful || return
|
__gitex_command_successful || return
|
||||||
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
|
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ __gitex_author_names() {
|
|||||||
local expl
|
local expl
|
||||||
declare -a author_names
|
declare -a author_names
|
||||||
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
|
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
|
||||||
__git_command_successful || return
|
__gitex_command_successful || return
|
||||||
_wanted author-names expl author-name compadd $* - $author_names
|
_wanted author-names expl author-name compadd $* - $author_names
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ function work_in_progress() {
|
|||||||
function git_main_branch() {
|
function git_main_branch() {
|
||||||
command git rev-parse --git-dir &>/dev/null || return
|
command git rev-parse --git-dir &>/dev/null || return
|
||||||
local ref
|
local ref
|
||||||
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk}; do
|
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default}; do
|
||||||
if command git show-ref -q --verify $ref; then
|
if command git show-ref -q --verify $ref; then
|
||||||
echo ${ref:t}
|
echo ${ref:t}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user