Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

bare_repo_test.go 788B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package integrations
  5. import (
  6. "net/http"
  7. "testing"
  8. "code.gitea.io/gitea/models"
  9. )
  10. func TestBareRepo(t *testing.T) {
  11. prepareTestEnv(t)
  12. subpaths := []string{
  13. "commits/master",
  14. "raw/foo",
  15. "commit/1ae57b34ccf7e18373",
  16. "graph",
  17. }
  18. bareRepo := models.AssertExistsAndLoadBean(t, &models.Repository{}, models.Cond("is_bare = ?", true)).(*models.Repository)
  19. owner := models.AssertExistsAndLoadBean(t, &models.User{ID: bareRepo.OwnerID}).(*models.User)
  20. for _, subpath := range subpaths {
  21. req := NewRequestf(t, "GET", "/%s/%s/%s", owner.Name, bareRepo.Name, subpath)
  22. MakeRequest(t, req, http.StatusNotFound)
  23. }
  24. }