Skip to content

Commit ae14fee

Browse files
authored
Merge pull request #409 from x-motemen/vcs-detection
refine git vcs backend detection
2 parents 785be66 + 38fabef commit ae14fee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

remote_repository.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,16 @@ func (repo *OtherRepository) VCS() (*VCSBackend, *url.URL, error) {
201201
return SubversionBackend, repo.URL(), nil
202202
}
203203

204+
// Detect VCS backend
205+
if repo.url.Scheme == "ssh" && repo.url.User.Username() == "git" {
206+
return GitBackend, repo.URL(), nil
207+
}
208+
204209
switch repo.url.Host {
205210
case "fossil-scm.org", "sqlite.org":
206211
return FossilBackend, repo.URL(), nil
207212
}
208213

209-
// Detect VCS backend automatically
210214
if cmdutil.RunSilently("git", "ls-remote", repo.url.String()) == nil {
211215
return GitBackend, repo.URL(), nil
212216
}

0 commit comments

Comments
 (0)