diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-26 14:00:39 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-26 14:08:32 +0300 |
commit | c7d0447a8c3cd8abd2aaa6eaef8208ed32d81356 (patch) | |
tree | 0ddce79c12f56c92f3e3ef443278508631697cd9 /internal/git2go | |
parent | d1bac7bc31c64c04ec67855c8f2c740275d9bc44 (diff) |
git: Move LocalRepository implementation into its own package
The LocalRepository implementation has grown quite a lot up to a point
where it's warrented to have its own package. So let's move it into
`internal/git/localrepo`, similar to the already existing
`internal/git/remoterepo` package.
Diffstat (limited to 'internal/git2go')
-rw-r--r-- | internal/git2go/apply_test.go | 4 | ||||
-rw-r--r-- | internal/git2go/commit_test.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/git2go/apply_test.go b/internal/git2go/apply_test.go index 07680ee0e..b782cf13e 100644 --- a/internal/git2go/apply_test.go +++ b/internal/git2go/apply_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/internal/gitaly/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) @@ -17,7 +17,7 @@ func TestExecutor_Apply(t *testing.T) { pbRepo, repoPath, clean := testhelper.InitBareRepo(t) defer clean() - repo := git.NewRepository(pbRepo, config.Config) + repo := localrepo.New(pbRepo, config.Config) executor := New(filepath.Join(config.Config.BinDir, "gitaly-git2go"), config.Config.Git.BinPath) ctx, cancel := testhelper.Context() diff --git a/internal/git2go/commit_test.go b/internal/git2go/commit_test.go index 8dd3dd3a2..1e4243c20 100644 --- a/internal/git2go/commit_test.go +++ b/internal/git2go/commit_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/internal/gitaly/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) @@ -55,7 +55,7 @@ func TestExecutor_Commit(t *testing.T) { pbRepo, repoPath, clean := testhelper.InitBareRepo(t) defer clean() - repo := git.NewRepository(pbRepo, config.Config) + repo := localrepo.New(pbRepo, config.Config) originalFile, err := repo.WriteBlob(ctx, "file", bytes.NewBufferString("original")) require.NoError(t, err) @@ -495,7 +495,7 @@ func TestExecutor_Commit(t *testing.T) { } } -func getCommit(t testing.TB, ctx context.Context, repo *git.LocalRepository, oid string) commit { +func getCommit(t testing.TB, ctx context.Context, repo *localrepo.Repo, oid string) commit { t.Helper() data, err := repo.ReadObject(ctx, oid) |