9950: Rename Root config to RepoRoot.
authorTom Clegg <tom@curoverse.com>
Wed, 21 Sep 2016 13:35:27 +0000 (09:35 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 26 Sep 2016 17:43:28 +0000 (13:43 -0400)
services/arv-git-httpd/auth_handler.go
services/arv-git-httpd/git_handler.go
services/arv-git-httpd/gitolite_test.go
services/arv-git-httpd/integration_test.go
services/arv-git-httpd/main.go
services/arv-git-httpd/usage.go

index 6ba0f387986111c805c3a631dc5666e16f75013b..31865011b79908a50f8c2d676c0f3e30fb6ad3d6 100644 (file)
@@ -137,7 +137,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
                "/" + 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
@@ -149,7 +149,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
        }
        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"
index f4baa725d1f3669c93281c346d719dc7ab732baf..f0b98fab72382dfa02c2b12a144e2a6b9f5190c4 100644 (file)
@@ -19,9 +19,9 @@ func newGitHandler() http.Handler {
        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,
                        },
index 96d9d24562195b99ef0be7dd9ff0fef6a115c0f6..d21a814a61ab88499f0434de5dc73fba1b0a7fc3 100644 (file)
@@ -48,7 +48,7 @@ func (s *GitoliteSuite) SetUpTest(c *check.C) {
                },
                Listen:     ":0",
                GitCommand: "/usr/share/gitolite3/gitolite-shell",
-               Root:       s.tmpRepoRoot,
+               RepoRoot:   s.tmpRepoRoot,
        }
        s.IntegrationSuite.SetUpTest(c)
 
index a548d6d0096602a92440f3ef609e296041457880..5ec5ccba02157242c8967a7b2292181ef62a0b6e 100644 (file)
@@ -74,7 +74,7 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) {
                        },
                        Listen:     ":0",
                        GitCommand: "/usr/bin/git",
-                       Root:       s.tmpRepoRoot,
+                       RepoRoot:   s.tmpRepoRoot,
                }
        }
        theConfig = s.Config
index 202e0a2aeaef8e54bb44f827948dead46350134f..ce18b713d72cc7feda757d257e1d8a408377b4a9 100644 (file)
@@ -16,7 +16,7 @@ type Config struct {
        Client     arvados.Client
        Listen     string
        GitCommand string
-       Root       string
+       RepoRoot   string
 }
 
 var theConfig = defaultConfig()
@@ -29,7 +29,7 @@ func defaultConfig() *Config {
        return &Config{
                Listen:     ":80",
                GitCommand: "/usr/bin/git",
-               Root:       cwd,
+               RepoRoot:   cwd,
        }
 }
 
@@ -40,7 +40,7 @@ func init() {
                "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`.")
@@ -78,7 +78,7 @@ func main() {
                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)
        }
index 649fb102ddd35b3f95f8c589bb9cc5d08717f4bc..a4a9900caabaa771812ea9c1a0c3cc91a320c5bb 100644 (file)
@@ -54,7 +54,7 @@ GitCommand:
     request will execute this program with the single argument
     "http-backend".
 
-Root:
+RepoRoot:
 
     Path to git repositories. Defaults to current working directory.