Skip to content

Commit 2a23598

Browse files
author
William Richard
committed
Make the regex looking for the main branch match the entire line
1 parent daaab1b commit 2a23598

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aliases/available/git.aliases.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function gdv() {
199199
}
200200

201201
function get_default_branch() {
202-
if git branch | grep -q '\smain\s'; then
202+
if git branch | grep -q '^. main\s*$'; then
203203
echo main
204204
else
205205
echo master

0 commit comments

Comments
 (0)