mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
add comment
This commit is contained in:
parent
628986a15e
commit
2aeefa5ea9
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue