mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
parent
6fe030fd44
commit
19e0efc1fc
|
@ -390,7 +390,11 @@ func (g *Git) getUpstreamIcon() string {
|
|||
url = strings.ReplaceAll(url, ":", "/")
|
||||
return fmt.Sprintf("https://%s", url)
|
||||
}
|
||||
|
||||
g.RawUpstreamURL = g.getRemoteURL()
|
||||
if len(g.RawUpstreamURL) == 0 {
|
||||
return ""
|
||||
}
|
||||
g.UpstreamURL = cleanSSHURL(g.RawUpstreamURL)
|
||||
|
||||
// allow overrides first
|
||||
|
|
|
@ -593,6 +593,7 @@ func TestGitUpstream(t *testing.T) {
|
|||
Expected string
|
||||
Upstream string
|
||||
}{
|
||||
{Case: "No upstream", Expected: "", Upstream: ""},
|
||||
{Case: "GitHub", Expected: "GH", Upstream: "github.com/test"},
|
||||
{Case: "Gitlab", Expected: "GL", Upstream: "gitlab.com/test"},
|
||||
{Case: "Bitbucket", Expected: "BB", Upstream: "bitbucket.org/test"},
|
||||
|
|
Loading…
Reference in a new issue