mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
cb7839090f
commit
1df98df6a6
|
@ -673,15 +673,18 @@ func (g *Git) WorktreeCount() int {
|
||||||
|
|
||||||
func (g *Git) getRemoteURL() string {
|
func (g *Git) getRemoteURL() string {
|
||||||
upstream := regex.ReplaceAllString("/.*", g.Upstream, "")
|
upstream := regex.ReplaceAllString("/.*", g.Upstream, "")
|
||||||
|
if len(upstream) == 0 {
|
||||||
|
return g.getGitCommandOutput("remote", "get-url", "origin")
|
||||||
|
}
|
||||||
cfg, err := ini.Load(g.rootDir + "/config")
|
cfg, err := ini.Load(g.rootDir + "/config")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return g.getGitCommandOutput("remote", "get-url", upstream)
|
return g.getGitCommandOutput("remote", "get-url", upstream)
|
||||||
}
|
}
|
||||||
url := cfg.Section("remote \"" + upstream + "\"").Key("url").String()
|
url := cfg.Section("remote \"" + upstream + "\"").Key("url").String()
|
||||||
if len(url) == 0 {
|
if len(url) != 0 {
|
||||||
url = g.getGitCommandOutput("remote", "get-url", upstream)
|
return url
|
||||||
}
|
}
|
||||||
return url
|
return g.getGitCommandOutput("remote", "get-url", upstream)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Git) getUntrackedFilesMode() string {
|
func (g *Git) getUntrackedFilesMode() string {
|
||||||
|
|
Loading…
Reference in a new issue