|
|
@ -18,19 +18,16 @@ _arguments -C -s -S \
|
|
|
|
case "$state" in
|
|
|
|
case "$state" in
|
|
|
|
(remote)
|
|
|
|
(remote)
|
|
|
|
remotes=($(
|
|
|
|
remotes=($(
|
|
|
|
git config -l \
|
|
|
|
git config --local --get-regexp 'remote.*.url' \
|
|
|
|
| grep 'remote\.[^.]*\.url' \
|
|
|
|
| awk 'BEGIN {FS="."} ; {print $2}'
|
|
|
|
| cut -d'.' -f2))
|
|
|
|
))
|
|
|
|
_describe -t branch 'remotes' remotes && ret=0
|
|
|
|
_describe -t branch 'remotes' remotes && ret=0
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
(branch)
|
|
|
|
(branch)
|
|
|
|
remote="$words[(($CURRENT - 1))]"
|
|
|
|
remote="$words[(($CURRENT - 1))]"
|
|
|
|
branches=($(
|
|
|
|
branches=($(
|
|
|
|
git branch -r \
|
|
|
|
git ls-remote --heads "$remote" \
|
|
|
|
| grep "${remote}/" \
|
|
|
|
| awk '{gsub(/refs\/heads\//, "", $2)} ; {print $2}'
|
|
|
|
| sed \
|
|
|
|
|
|
|
|
-e "/${remote}\/HEAD -> ${remote}/d" \
|
|
|
|
|
|
|
|
-e "s/^[[:space:]]*${remote}\///g"
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
_describe -t branch 'branches' branches && ret=0
|
|
|
|
_describe -t branch 'branches' branches && ret=0
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|