mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
git: use master if it exists, otherwise use main
See https://github.com/ohmyzsh/ohmyzsh/pull/9049#issuecomment-654537347 Co-authored-by: Yufan You <ouuansteve@gmail.com>
This commit is contained in:
parent
d79941b789
commit
1db79f97f5
2 changed files with 6 additions and 6 deletions
|
|
@ -27,10 +27,10 @@ function work_in_progress() {
|
|||
|
||||
# Check if main exists and use instead of master
|
||||
function git_main_branch() {
|
||||
if [[ -n "$(git branch --list main)" ]]; then
|
||||
echo main
|
||||
else
|
||||
if [[ -n "$(git branch --list master)" ]]; then
|
||||
echo master
|
||||
else
|
||||
echo main
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue