Updated logic for new local branch
This commit is contained in:
parent
a37246872b
commit
d4ad16fe16
@ -83,7 +83,11 @@ func (p *Project) GetGitInfo() string {
|
||||
head, _ := repo.Head()
|
||||
branch := head.Name().String()[11:]
|
||||
b, _ := repo.Branch(branch)
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user