Commit 3bbc8263 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gpull: use remote branch name if local name does not exists there

parent 15a9ba3f
...@@ -66,6 +66,13 @@ pull_all_branches() ...@@ -66,6 +66,13 @@ pull_all_branches()
docmd git checkout $CURRENTBRANCH docmd git checkout $CURRENTBRANCH
} }
# Если не получилось получить обновление по такому же названию бранча, как локальный, то получаем по удалённому
pull_from_unique_branch()
{
REMOTEBRANCH=$(git branch -a | grep "^ remotes/$REPO/" | sed -e "s|.*remotes/$REPO/||")
docmd git pull $REBASE $REPO $REMOTEBRANCH
}
if [ -n "$ALLBRANCHES" ] ; then if [ -n "$ALLBRANCHES" ] ; then
pull_all_branches pull_all_branches
exit exit
...@@ -86,7 +93,8 @@ if [ -n "$CHECKRESULT" ] ; then ...@@ -86,7 +93,8 @@ if [ -n "$CHECKRESULT" ] ; then
fi fi
docmd git fetch $REPO || exit docmd git fetch $REPO || exit
docmd git pull $REBASE $REPO $REMOTEBRANCH || exit # FIXME: Не факт, что удалённо бранч называется именно $REMOTEBRANCH
docmd git pull $REBASE $REPO $REMOTEBRANCH || pull_from_unique_branch || exit
# REWRITE ME: assure we get tags # REWRITE ME: assure we get tags
docmd git pull --tags $REPO $REMOTEBRANCH docmd git pull --tags $REPO $REMOTEBRANCH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment