Unverified Commit e2f2489a authored by Joseph Heyburn's avatar Joseph Heyburn Committed by GitHub
Browse files

fix(git): silently fail in `git_main_branch` if not in a git repo (#9484)


Co-authored-by: default avatarMarc Cornellà <marc.cornella@live.com>
parent 452586e7
......@@ -31,6 +31,7 @@ function work_in_progress() {
# Check if main exists and use instead of master
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return
local branch
for branch in main trunk; do
if command git show-ref -q --verify refs/heads/$branch; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment