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()