diff options
Diffstat (limited to 'internal/git/gittest/repo.go')
-rw-r--r-- | internal/git/gittest/repo.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/git/gittest/repo.go b/internal/git/gittest/repo.go index 53bac2e1a..44e1d401b 100644 --- a/internal/git/gittest/repo.go +++ b/internal/git/gittest/repo.go @@ -118,6 +118,14 @@ func CloneRepoWithWorktree(t testing.TB) (repo *gitalypb.Repository, repoPath st return cloneRepo(t, testhelper.GitlabTestStoragePath(), NewRepositoryName(t, false), false) } +// CloneRepoWithWorktree creates a copy of the test repository with a worktree. This is allows you +// to run normal 'non-bare' Git commands. +func CloneRepoWithWorktreeAtStorage(t testing.TB, storage config.Storage) (*gitalypb.Repository, string, testhelper.Cleanup) { + repo, repoPath, cleanup := cloneRepo(t, storage.Path, NewRepositoryName(t, false), false) + repo.StorageName = storage.Name + return repo, repoPath, cleanup +} + // testRepositoryPath returns the absolute path of local 'gitlab-org/gitlab-test.git' clone. // It is cloned under the path by the test preparing step of make. func testRepositoryPath(t testing.TB) string { |