mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
refine git vcs backend detection
This commit is contained in:
parent
785be66cd2
commit
38fabef772
|
|
@ -201,12 +201,16 @@ func (repo *OtherRepository) VCS() (*VCSBackend, *url.URL, error) {
|
|||
return SubversionBackend, repo.URL(), nil
|
||||
}
|
||||
|
||||
// Detect VCS backend
|
||||
if repo.url.Scheme == "ssh" && repo.url.User.Username() == "git" {
|
||||
return GitBackend, repo.URL(), nil
|
||||
}
|
||||
|
||||
switch repo.url.Host {
|
||||
case "fossil-scm.org", "sqlite.org":
|
||||
return FossilBackend, repo.URL(), nil
|
||||
}
|
||||
|
||||
// Detect VCS backend automatically
|
||||
if cmdutil.RunSilently("git", "ls-remote", repo.url.String()) == nil {
|
||||
return GitBackend, repo.URL(), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue