Skip to content

Commit

Permalink
refine git vcs backend detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Nov 9, 2024
1 parent 785be66 commit 38fabef
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 38fabef

Please sign in to comment.