From d0059fcb87312d296a31d6965d6db84e499fe020 Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Mon, 17 Apr 2023 14:43:15 +0200 Subject: Only use compact URL in UI, not in written files many tools like eg some vscode extensions can parse the git remotes but do not respect git aliases and fail to understand shorthands like gh:majewsky/gofu --- internal/rtree/repo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/rtree/repo.go') diff --git a/internal/rtree/repo.go b/internal/rtree/repo.go index 5cdd39f..2267666 100644 --- a/internal/rtree/repo.go +++ b/internal/rtree/repo.go @@ -153,7 +153,7 @@ func (r Repo) Checkout() error { cli.Interface.ShowWarning(`will not checkout anything since there is no remote named "origin"`) } else { err := cli.Interface.Run(cli.Command{ - Program: []string{"git", "clone", originURL.CompactURL(), r.AbsolutePath()}, + Program: []string{"git", "clone", originURL.CanonicalURL(), r.AbsolutePath()}, }) if err != nil { return err @@ -164,7 +164,7 @@ func (r Repo) Checkout() error { for _, remote := range r.Remotes { if remote.Name != "origin" { err := cli.Interface.Run(cli.Command{ - Program: []string{"git", "remote", "add", remote.Name, remote.URL.CompactURL()}, + Program: []string{"git", "remote", "add", remote.Name, remote.URL.CanonicalURL()}, WorkDir: r.AbsolutePath(), }) if err != nil { @@ -234,7 +234,7 @@ func (r *Repo) Move(checkoutPath string, makeSymlink bool) error { func (r Repo) ReformatRemoteURLs() error { for _, remote := range r.Remotes { err := cli.Interface.Run(cli.Command{ - Program: []string{"git", "remote", "set-url", remote.Name, remote.URL.CompactURL()}, + Program: []string{"git", "remote", "set-url", remote.Name, remote.URL.CanonicalURL()}, WorkDir: r.AbsolutePath(), }) if err != nil { -- cgit v1.3.1