revert 95a5492483
revert bash: gc: set default branch programatically Signed-off-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
parent
076d658aa8
commit
9dc37c67cc
1 changed files with 4 additions and 4 deletions
|
@ -150,11 +150,11 @@ EOF
|
||||||
*)
|
*)
|
||||||
if [ ! -z $1 ] ; then
|
if [ ! -z $1 ] ; then
|
||||||
(echo ">>> Try local checkout" && git checkout --quiet "$1" > /dev/null 2>&1) ||
|
(echo ">>> Try local checkout" && git checkout --quiet "$1" > /dev/null 2>&1) ||
|
||||||
(echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unknown branch!")
|
(echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch!")
|
||||||
else
|
else
|
||||||
echo ">>> get default branch"
|
(git checkout --quiet master > /dev/null 2>&1 && echo '>>> Try checking out master') ||
|
||||||
default_branch=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
|
(git checkout --quiet main > /dev/null 2>&1 && echo '>>> Try checking out main') ||
|
||||||
git checkout --quiet ${default_branch} > /dev/null 2>&1
|
(git checkout --quiet release > /dev/null 2>&1 && echo '>>> Try checking out release')
|
||||||
fi
|
fi
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue