Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-18 18:05:11 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-24 10:45:54 +0300
commit18390003bbd503da6687608ec3ee73f83bfcc9eb (patch)
tree4eba90631ccffb34ca0a769c312c2c39a7f2b6e0
parent84bded96bbdc96e7d2cd4e38c31e649d06017fc1 (diff)
packfile: Create "empty.git" in temporary directory
We're currently creating the test Git repository in testdata. This commit instead moves it into the global temporary test directory.
-rw-r--r--internal/git/packfile/packfile_test.go6
-rw-r--r--internal/git/packfile/testdata/.gitkeep0
2 files changed, 4 insertions, 2 deletions
diff --git a/internal/git/packfile/packfile_test.go b/internal/git/packfile/packfile_test.go
index 7f5767b4c..6e5df3780 100644
--- a/internal/git/packfile/packfile_test.go
+++ b/internal/git/packfile/packfile_test.go
@@ -21,8 +21,10 @@ func testMain(m *testing.M) int {
}
func TestList(t *testing.T) {
- repoPath0 := "testdata/empty.git"
- require.NoError(t, os.RemoveAll(repoPath0))
+ tempDir, cleanup := testhelper.TempDir(t)
+ defer cleanup()
+
+ repoPath0 := filepath.Join(tempDir, "empty.git")
testhelper.MustRunCommand(t, nil, "git", "init", "--bare", repoPath0)
_, repoPath1, cleanup1 := testhelper.NewTestRepo(t)
diff --git a/internal/git/packfile/testdata/.gitkeep b/internal/git/packfile/testdata/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/internal/git/packfile/testdata/.gitkeep
+++ /dev/null