18947: Use git-ls-files instead of git-grep to find go dirs.
[arvados.git] / services / arv-git-httpd / gitolite_test.go
index 5f3cc608c3a9d360518dda68d47d1cde901cc459..cfedd88f170841dc9fbc16a0ebbc0a0127de5459 100644 (file)
@@ -54,7 +54,7 @@ func (s *GitoliteSuite) SetUpTest(c *check.C) {
        s.cluster, err = cfg.GetCluster("")
        c.Assert(err, check.Equals, nil)
 
-       s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: "localhost:0"}: arvados.ServiceInstance{}}
+       s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{{Host: "localhost:0"}: {}}
        s.cluster.TLS.Insecure = true
        s.cluster.Git.GitCommand = "/usr/share/gitolite3/gitolite-shell"
        s.cluster.Git.GitoliteHome = s.gitoliteHome
@@ -81,7 +81,7 @@ func (s *GitoliteSuite) TearDownTest(c *check.C) {
 }
 
 func (s *GitoliteSuite) TestFetch(c *check.C) {
-       err := s.RunGit(c, activeToken, "fetch", "active/foo.git")
+       err := s.RunGit(c, activeToken, "fetch", "active/foo.git", "refs/heads/main")
        c.Check(err, check.Equals, nil)
 }
 
@@ -91,7 +91,7 @@ func (s *GitoliteSuite) TestFetchUnreadable(c *check.C) {
 }
 
 func (s *GitoliteSuite) TestPush(c *check.C) {
-       err := s.RunGit(c, activeToken, "push", "active/foo.git", "master:gitolite-push")
+       err := s.RunGit(c, activeToken, "push", "active/foo.git", "main:gitolite-push")
        c.Check(err, check.Equals, nil)
 
        // Check that the commit hash appears in the gitolite log, as
@@ -109,6 +109,6 @@ func (s *GitoliteSuite) TestPush(c *check.C) {
 }
 
 func (s *GitoliteSuite) TestPushUnwritable(c *check.C) {
-       err := s.RunGit(c, spectatorToken, "push", "active/foo.git", "master:gitolite-push-fail")
+       err := s.RunGit(c, spectatorToken, "push", "active/foo.git", "main:gitolite-push-fail")
        c.Check(err, check.ErrorMatches, `.*HTTP (code = )?403.*`)
 }