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()
|
head, _ := repo.Head()
|
||||||
branch := head.Name().String()[11:]
|
branch := head.Name().String()[11:]
|
||||||
b, _ := repo.Branch(branch)
|
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())
|
commit, _ := repo.CommitObject(head.Hash())
|
||||||
str += commit.String()
|
str += commit.String()
|
||||||
|
Loading…
Reference in New Issue
Block a user