add comment

This commit is contained in:
Songmu 2019-05-07 03:46:56 +09:00
parent 628986a15e
commit 2aeefa5ea9

View file

@ -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")
}