Use \s instead of \b
\b matches things like - and _, which is often used in branch namespull/1981/head
parent
98bd0ae149
commit
daaab1b73d
|
|
@ -199,7 +199,7 @@ function gdv() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_default_branch() {
|
function get_default_branch() {
|
||||||
if git branch | grep -q '\main\b'; then
|
if git branch | grep -q '\smain\s'; then
|
||||||
echo main
|
echo main
|
||||||
else
|
else
|
||||||
echo master
|
echo master
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue