summaryrefslogtreecommitdiff
path: root/internal/rtree/repo.go
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@sap.com>2023-04-17 14:43:15 +0200
committerSandro Jäckel <sandro.jaeckel@sap.com>2023-04-17 14:56:16 +0200
commitd0059fcb87312d296a31d6965d6db84e499fe020 (patch)
treeea285343822712bf002ad6dee0b11a094b442e2d /internal/rtree/repo.go
parent72c757b7a44dc5d19d821f7c2fa36bb082e4f2e3 (diff)
downloadgofu-d0059fcb87312d296a31d6965d6db84e499fe020.tar.gz
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
Diffstat (limited to 'internal/rtree/repo.go')
-rw-r--r--internal/rtree/repo.go6
1 files changed, 3 insertions, 3 deletions
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 {