Skip to content

Commit

Permalink
feat(git): remove trailing spaces for remote icons
Browse files Browse the repository at this point in the history
resolves #6112
  • Loading branch information
JanDeDobbeleer committed Jan 26, 2025
1 parent 1e6ee3e commit 24b446d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/segments/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,13 @@ func (g *Git) getUpstreamIcon() string {
Icon properties.Property
Default string
}{
"github": {GithubIcon, "\uF408 "},
"gitlab": {GitlabIcon, "\uF296 "},
"bitbucket": {BitbucketIcon, "\uF171 "},
"dev.azure.com": {AzureDevOpsIcon, "\uEBE8 "},
"visualstudio.com": {AzureDevOpsIcon, "\uEBE8 "},
"codecommit": {CodeCommit, "\uF270 "},
"codeberg": {CodebergIcon, "\uF330 "},
"github": {GithubIcon, "\uF408"},
"gitlab": {GitlabIcon, "\uF296"},
"bitbucket": {BitbucketIcon, "\uF171"},
"dev.azure.com": {AzureDevOpsIcon, "\uEBE8"},
"visualstudio.com": {AzureDevOpsIcon, "\uEBE8"},
"codecommit": {CodeCommit, "\uF270"},
"codeberg": {CodebergIcon, "\uF330"},
}
for key, value := range defaults {
if strings.Contains(g.UpstreamURL, key) {
Expand Down
8 changes: 4 additions & 4 deletions src/segments/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestEnabledInBareRepo(t *testing.T) {
FetchRemote: true,
Remote: "origin",
RemoteURL: "[email protected]:JanDeDobbeleer/oh-my-posh.git",
ExpectedRemote: "\uf408 ",
ExpectedRemote: "\uf408",
},
}
for _, tc := range cases {
Expand All @@ -201,9 +201,9 @@ func TestEnabledInBareRepo(t *testing.T) {
g := &Git{}
g.Init(props, env)

assert.Equal(t, g.Enabled(), tc.ExpectedEnabled, tc.Case)
assert.Equal(t, g.Ref, tc.ExpectedHEAD, tc.Case)
assert.Equal(t, g.UpstreamIcon, tc.ExpectedRemote, tc.Case)
assert.Equal(t, tc.ExpectedEnabled, g.Enabled(), tc.Case)
assert.Equal(t, tc.ExpectedHEAD, g.Ref, tc.Case)
assert.Equal(t, tc.ExpectedRemote, g.UpstreamIcon, tc.Case)
}
}

Expand Down

0 comments on commit 24b446d

Please sign in to comment.