mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-10-02 16:03:47 +02:00
fix(git): silently fail in git_main_branch if not in a git repo (#9484)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
This commit is contained in:
1 parent
452586e79a
commit
e2f2489a66
1 file changed
+1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user