Skip to content

Commit

Permalink
Merge pull request #409 from x-motemen/vcs-detection
Browse files Browse the repository at this point in the history
refine git vcs backend detection
  • Loading branch information
Songmu authored Nov 9, 2024
2 parents 785be66 + 38fabef commit ae14fee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion remote_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ae14fee

Please sign in to comment.