aliases: git: Modernize get default branch function

pull/2176/head
Roy Attias 2022-12-02 21:28:14 +02:00 committed by Roy Attias
parent ad2b55804e
commit ac69c5585e
1 changed files with 1 additions and 5 deletions

View File

@ -200,9 +200,5 @@ function gdv() {
} }
function get_default_branch() { function get_default_branch() {
if git branch | grep -q '^. main\s*$'; then git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
echo main
else
echo master
fi
} }