mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
refactor: make true string constant
This commit is contained in:
parent
1298129b87
commit
54c5262a27
|
@ -113,6 +113,8 @@ const (
|
|||
DETACHED = "(detached)"
|
||||
BRANCHPREFIX = "ref: refs/heads/"
|
||||
GITCOMMAND = "git"
|
||||
|
||||
trueStr = "true"
|
||||
)
|
||||
|
||||
type Git struct {
|
||||
|
@ -278,7 +280,7 @@ func (g *Git) shouldDisplay() bool {
|
|||
}
|
||||
g.realDir = g.env.Pwd()
|
||||
bare := g.getGitCommandOutput("rev-parse", "--is-bare-repository")
|
||||
if bare == "true" {
|
||||
if bare == trueStr {
|
||||
g.IsBare = true
|
||||
g.workingDir = g.realDir
|
||||
return true
|
||||
|
|
|
@ -165,7 +165,7 @@ func TestEnabledInBareRepo(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
Case: "Bare repo on main",
|
||||
IsBare: "true",
|
||||
IsBare: trueStr,
|
||||
HEAD: "ref: refs/heads/main",
|
||||
ExpectedEnabled: true,
|
||||
ExpectedHEAD: "main",
|
||||
|
@ -176,7 +176,7 @@ func TestEnabledInBareRepo(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Case: "Bare repo on main remote enabled",
|
||||
IsBare: "true",
|
||||
IsBare: trueStr,
|
||||
HEAD: "ref: refs/heads/main",
|
||||
ExpectedEnabled: true,
|
||||
ExpectedHEAD: "main",
|
||||
|
|
Loading…
Reference in a new issue