Use /b to find the default branch, instead of start/end of line
This commit is contained in:
@@ -199,7 +199,7 @@ function gdv() {
|
||||
}
|
||||
|
||||
function get_default_branch() {
|
||||
if git branch | grep -q '^main$'; then
|
||||
if git branch | grep -q '\main\b'; then
|
||||
echo main
|
||||
else
|
||||
echo master
|
||||
|
||||
Reference in New Issue
Block a user