"/" + repoName + "/.git",
}
for _, dir := range tryDirs {
- if fileInfo, err := os.Stat(theConfig.Root + dir); err != nil {
+ if fileInfo, err := os.Stat(theConfig.RepoRoot + dir); err != nil {
if !os.IsNotExist(err) {
statusCode, statusText = http.StatusInternalServerError, err.Error()
return
}
if rewrittenPath == "" {
log.Println("WARNING:", repoUUID,
- "git directory not found in", theConfig.Root, tryDirs)
+ "git directory not found in", theConfig.RepoRoot, tryDirs)
// We say "content not found" to disambiguate from the
// earlier "API says that repo does not exist" error.
statusCode, statusText = http.StatusNotFound, "content not found"
return &gitHandler{
Handler: cgi.Handler{
Path: theConfig.GitCommand,
- Dir: theConfig.Root,
+ Dir: theConfig.RepoRoot,
Env: []string{
- "GIT_PROJECT_ROOT=" + theConfig.Root,
+ "GIT_PROJECT_ROOT=" + theConfig.RepoRoot,
"GIT_HTTP_EXPORT_ALL=",
"SERVER_ADDR=" + theConfig.Listen,
},
},
Listen: ":0",
GitCommand: "/usr/share/gitolite3/gitolite-shell",
- Root: s.tmpRepoRoot,
+ RepoRoot: s.tmpRepoRoot,
}
s.IntegrationSuite.SetUpTest(c)
},
Listen: ":0",
GitCommand: "/usr/bin/git",
- Root: s.tmpRepoRoot,
+ RepoRoot: s.tmpRepoRoot,
}
}
theConfig = s.Config
Client arvados.Client
Listen string
GitCommand string
- Root string
+ RepoRoot string
}
var theConfig = defaultConfig()
return &Config{
Listen: ":80",
GitCommand: "/usr/bin/git",
- Root: cwd,
+ RepoRoot: cwd,
}
}
"Address to listen on, \"host:port\" or \":port\"."+deprecated)
flag.StringVar(&theConfig.GitCommand, "git-command", theConfig.GitCommand,
"Path to git or gitolite-shell executable. Each authenticated request will execute this program with a single argument, \"http-backend\"."+deprecated)
- flag.StringVar(&theConfig.Root, "repo-root", theConfig.Root,
+ flag.StringVar(&theConfig.RepoRoot, "repo-root", theConfig.RepoRoot,
"Path to git repositories."+deprecated)
cfgPath := flag.String("config", defaultCfgPath, "Configuration file `path`.")
log.Fatal(err)
}
log.Println("Listening at", srv.Addr)
- log.Println("Repository root", theConfig.Root)
+ log.Println("Repository root", theConfig.RepoRoot)
if err := srv.Wait(); err != nil {
log.Fatal(err)
}
request will execute this program with the single argument
"http-backend".
-Root:
+RepoRoot:
Path to git repositories. Defaults to current working directory.