2018-02-05 10:44:59 -05:00
|
|
|
# vim:et sts=2 sw=2 ft=zsh
|
|
|
|
local -a remotes
|
2018-04-13 16:13:43 -04:00
|
|
|
if (( ${*[(I)(-r|--remotes)]} )); then
|
2018-02-05 10:44:59 -05:00
|
|
|
remotes=(${^*:#-*})
|
|
|
|
else
|
2018-04-25 20:20:51 -04:00
|
|
|
remotes=(${(f)"$(command git rev-parse --abbrev-ref ${^*:#-*}@{u} 2>/dev/null)"}) || remotes=()
|
2018-02-05 10:44:59 -05:00
|
|
|
fi
|
|
|
|
if command git branch --delete ${@} && \
|
|
|
|
(( ${#remotes[@]} )) && \
|
|
|
|
read -q "?Also delete remote branch(es) ${remotes} [y/N]? "; then
|
|
|
|
print
|
|
|
|
local remote
|
2018-04-25 09:59:19 -04:00
|
|
|
for remote (${remotes}) command git push ${remote%%/*} :${remote#*/}
|
2018-02-05 10:44:59 -05:00
|
|
|
fi
|