@@ -31,6 +31,7 @@ import (
3131 "github.com/fluxcd/pkg/version"
3232
3333 "github.com/fluxcd/source-controller/pkg/git"
34+ "github.com/fluxcd/source-controller/pkg/git/libgit2/managed"
3435)
3536
3637// CheckoutStrategyForOptions returns the git.CheckoutStrategy for the given
@@ -72,7 +73,7 @@ func (c *CheckoutBranch) Checkout(ctx context.Context, path, url string, opts *g
7273 CheckoutBranch : c .Branch ,
7374 })
7475 if err != nil {
75- return nil , fmt .Errorf ("unable to clone '%s': %w" , url , gitutil .LibGit2Error (err ))
76+ return nil , fmt .Errorf ("unable to clone '%s': %w" , managed . EffectiveURL ( url ) , gitutil .LibGit2Error (err ))
7677 }
7778 defer repo .Free ()
7879 head , err := repo .Head ()
@@ -101,7 +102,7 @@ func (c *CheckoutTag) Checkout(ctx context.Context, path, url string, opts *git.
101102 },
102103 })
103104 if err != nil {
104- return nil , fmt .Errorf ("unable to clone '%s': %w" , url , gitutil .LibGit2Error (err ))
105+ return nil , fmt .Errorf ("unable to clone '%s': %w" , managed . EffectiveURL ( url ) , gitutil .LibGit2Error (err ))
105106 }
106107 defer repo .Free ()
107108 cc , err := checkoutDetachedDwim (repo , c .Tag )
@@ -125,7 +126,7 @@ func (c *CheckoutCommit) Checkout(ctx context.Context, path, url string, opts *g
125126 },
126127 })
127128 if err != nil {
128- return nil , fmt .Errorf ("unable to clone '%s': %w" , url , gitutil .LibGit2Error (err ))
129+ return nil , fmt .Errorf ("unable to clone '%s': %w" , managed . EffectiveURL ( url ) , gitutil .LibGit2Error (err ))
129130 }
130131 defer repo .Free ()
131132 oid , err := git2go .NewOid (c .Commit )
@@ -157,7 +158,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, opts *g
157158 },
158159 })
159160 if err != nil {
160- return nil , fmt .Errorf ("unable to clone '%s': %w" , url , gitutil .LibGit2Error (err ))
161+ return nil , fmt .Errorf ("unable to clone '%s': %w" , managed . EffectiveURL ( url ) , gitutil .LibGit2Error (err ))
161162 }
162163 defer repo .Free ()
163164
0 commit comments