From 07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 18 Jan 2019 00:01:04 +0000 Subject: Refactor repo.isBare to repo.isEmpty #5629 (#5714) * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton * Remove Sync call --- integrations/bare_repo_test.go | 28 ---------------------------- integrations/empty_repo_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 integrations/bare_repo_test.go create mode 100644 integrations/empty_repo_test.go (limited to 'integrations') diff --git a/integrations/bare_repo_test.go b/integrations/bare_repo_test.go deleted file mode 100644 index e693c181dd..0000000000 --- a/integrations/bare_repo_test.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package integrations - -import ( - "net/http" - "testing" - - "code.gitea.io/gitea/models" -) - -func TestBareRepo(t *testing.T) { - prepareTestEnv(t) - subpaths := []string{ - "commits/master", - "raw/foo", - "commit/1ae57b34ccf7e18373", - "graph", - } - bareRepo := models.AssertExistsAndLoadBean(t, &models.Repository{}, models.Cond("is_bare = ?", true)).(*models.Repository) - owner := models.AssertExistsAndLoadBean(t, &models.User{ID: bareRepo.OwnerID}).(*models.User) - for _, subpath := range subpaths { - req := NewRequestf(t, "GET", "/%s/%s/%s", owner.Name, bareRepo.Name, subpath) - MakeRequest(t, req, http.StatusNotFound) - } -} diff --git a/integrations/empty_repo_test.go b/integrations/empty_repo_test.go new file mode 100644 index 0000000000..2d72546e7d --- /dev/null +++ b/integrations/empty_repo_test.go @@ -0,0 +1,28 @@ +// Copyright 2017 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package integrations + +import ( + "net/http" + "testing" + + "code.gitea.io/gitea/models" +) + +func TestEmptyRepo(t *testing.T) { + prepareTestEnv(t) + subpaths := []string{ + "commits/master", + "raw/foo", + "commit/1ae57b34ccf7e18373", + "graph", + } + emptyRepo := models.AssertExistsAndLoadBean(t, &models.Repository{}, models.Cond("is_empty = ?", true)).(*models.Repository) + owner := models.AssertExistsAndLoadBean(t, &models.User{ID: emptyRepo.OwnerID}).(*models.User) + for _, subpath := range subpaths { + req := NewRequestf(t, "GET", "/%s/%s/%s", owner.Name, emptyRepo.Name, subpath) + MakeRequest(t, req, http.StatusNotFound) + } +} -- cgit v1.2.3