Use \s instead of \b

\b matches things like - and _, which is often used in branch names
pull/1981/head
William Richard 2021-10-25 11:55:26 -04:00
parent 98bd0ae149
commit daaab1b73d
No known key found for this signature in database
GPG Key ID: ACD9DA4E735E6D14
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ function gdv() {
}
function get_default_branch() {
if git branch | grep -q '\main\b'; then
if git branch | grep -q '\smain\s'; then
echo main
else
echo master