From 2aeefa5ea9e98495c641b81a79b1abb1434fc52a Mon Sep 17 00:00:00 2001 From: Songmu Date: Tue, 7 May 2019 03:46:56 +0900 Subject: [PATCH] add comment --- getter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/getter.go b/getter.go index 2f38c2a..d4d8552 100644 --- a/getter.go +++ b/getter.go @@ -119,6 +119,9 @@ func (g *getter) getRemoteRepository(remote RemoteRepository) error { if vcs == nil { return fmt.Errorf("Could not find version control system: %s", remoteURL) } + // Only when repoURL is a subpath of remoteURL, rebuild repoPath. + // This is because there is a case, for example, golang.org/x is hosted + // on go.googlesource.com. if strings.HasPrefix(remoteURL.String(), strings.TrimSuffix(repoURL.String(), ".git")) { repoPath = strings.TrimSuffix(filepath.Join(root, repoURL.Host, repoURL.Path), ".git") }