Reflect that VCS[ scheme] is always git

git-svn-id: https://svn.yakumo.dev/yakumo.izuru/toyohime/trunk@97 922d331f-388e-da47-97a9-ad700dc0b8b9
This commit is contained in:
jonbetti 2018-06-07 18:02:52 +00:00
parent c63f16a44e
commit 66ac399c85

View File

@ -160,20 +160,20 @@ func WithGogsStyleSource(importPath, repoPath, ref string) Option {
}
// Creates a Handler that serves a GitHub repository at a specific importPath.
func GitHubHandler(importPath, user, repo, vcsScheme string) http.Handler {
func GitHubHandler(importPath, user, repo, gitScheme string) http.Handler {
ghImportPath := "github.com/" + user + "/" + repo
return Handler(
WithImport(importPath, "git", vcsScheme+"://"+ghImportPath),
WithImport(importPath, "git", gitScheme+"://"+ghImportPath),
WithGitHubStyleSource(importPath, "https://"+ghImportPath, "master"),
)
}
// Creates a Handler that serves a repository hosted with Gogs at host at a
// specific importPath.
func GogsHandler(importPath, host, user, repo, vcsScheme string) http.Handler {
func GogsHandler(importPath, host, user, repo, gitScheme string) http.Handler {
gogsImportPath := host + "/" + user + "/" + repo
return Handler(
WithImport(importPath, "git", vcsScheme+"://"+gogsImportPath),
WithImport(importPath, "git", gitScheme+"://"+gogsImportPath),
WithGogsStyleSource(importPath, "https://"+gogsImportPath, "master"),
)
}