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