Namespace git commands under heroku
This commit is contained in:
parent
d5674edf44
commit
779b6020b6
10
src/_heroku
10
src/_heroku
|
@ -166,14 +166,14 @@ _arguments \
|
||||||
'(-r|--remote)'{-r,--remote}'[the git remote name]:remote:->remotes' \
|
'(-r|--remote)'{-r,--remote}'[the git remote name]:remote:->remotes' \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
__git_remotes () {
|
__heroku_git_remotes () {
|
||||||
local expl gitdir remotes
|
local expl gitdir remotes
|
||||||
|
|
||||||
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
||||||
__git_command_successful || return
|
__heroku_git_command_successful || return
|
||||||
|
|
||||||
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
||||||
__git_command_successful || return
|
__heroku_git_command_successful || return
|
||||||
|
|
||||||
# TODO: Should combine the two instead of either or.
|
# TODO: Should combine the two instead of either or.
|
||||||
if (( $#remotes > 0 )); then
|
if (( $#remotes > 0 )); then
|
||||||
|
@ -183,7 +183,7 @@ __git_remotes () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
__git_command_successful () {
|
__heroku_git_command_successful () {
|
||||||
if (( ${#pipestatus:#0} > 0 )); then
|
if (( ${#pipestatus:#0} > 0 )); then
|
||||||
_message 'not a git repository'
|
_message 'not a git repository'
|
||||||
return 1
|
return 1
|
||||||
|
@ -193,7 +193,7 @@ __git_command_successful () {
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(remotes)
|
(remotes)
|
||||||
__git_remotes && return 0
|
__heroku_git_remotes && return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue