detect the branch to use

This commit is contained in:
Aaron Bieber 2020-10-02 14:13:07 +00:00
parent 4203badd3a
commit f85d8fded0

View File

@ -10,11 +10,14 @@ function got-push {
}
function got-sync {
local _remote
local _remote _info _branch
_remote=$1
[ -z $_remote ] && _remote="origin"
got fetch "$_remote" && got update -b "$_remote/master" && \
got rebase master
_info="$(got info)"
_branch="$(echo "$_info" | awk '/branch reference:/ {l = split($NF, a, "/"); print a[l]}')"
[ -z $_remote ] && _remote="origin"
[ -z $_branch ] && _branch="main"
got fetch "$_remote" && got update -b "$_remote/$_branch" && \
got rebase $_branch
}
function got-clean {