Add stable to the list of options of git_main_branch

This commits adds the option `stable` to the available list of options used by the `git_main_branch` function, that returns the main used by the git repository.
This commit is contained in:
Jesús Miguel Benito Calzada 2024-05-23 11:46:26 +02:00 committed by GitHub
commit 04622b6ca0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,7 +35,7 @@ function git_develop_branch() {
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return
local ref
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}; do
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,stable,master}; do
if command git show-ref -q --verify $ref; then
echo ${ref:t}
return 0