From d4ad16fe165c641c80888c2eeb0556db0f017be8 Mon Sep 17 00:00:00 2001 From: Ryan D McGuire Date: Mon, 11 Dec 2023 11:50:11 -0500 Subject: [PATCH] Updated logic for new local branch --- internal/gitlab/gitlab.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/gitlab/gitlab.go b/internal/gitlab/gitlab.go index a577b28..8f9f114 100644 --- a/internal/gitlab/gitlab.go +++ b/internal/gitlab/gitlab.go @@ -83,7 +83,11 @@ func (p *Project) GetGitInfo() string { head, _ := repo.Head() branch := head.Name().String()[11:] b, _ := repo.Branch(branch) - str = "\n" + pterm.LightCyan("Branch: ") + pterm.Bold.Sprint(b.Name) + "\n" + if b != nil { + str = "\n" + pterm.LightCyan("Branch: ") + pterm.Bold.Sprint(b.Name) + "\n" + } else { + str = "\n" + pterm.LightCyan("NEW Branch: ") + pterm.Bold.Sprint(branch) + "\n" + } commit, _ := repo.CommitObject(head.Hash()) str += commit.String()