From 38fabef7721c7e39b9c409f1b73dce3115559b0f Mon Sep 17 00:00:00 2001 From: Songmu Date: Sat, 9 Nov 2024 15:40:25 +0900 Subject: [PATCH] refine git vcs backend detection --- remote_repository.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/remote_repository.go b/remote_repository.go index 52546dc..624b61a 100644 --- a/remote_repository.go +++ b/remote_repository.go @@ -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 }