diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-03-22 06:48:01 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-03-22 06:48:01 +0300 |
commit | 82b151a8899eb49d04600ec17c84042736949f48 (patch) | |
tree | d37c80cbaecb5000631bd332632f5691322ba9bb | |
parent | c4030b2e8f984424f37f2310a7266bb690c8e435 (diff) | |
parent | 49f7cf01dbb4f2273c666b200eb3a9439f4529a4 (diff) |
Merge branch 'jc/lstree-to-localrepo' into 'master'
lstree: Move package to localrepo
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5541
Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Co-authored-by: John Cai <jcai@gitlab.com>
-rw-r--r-- | cmd/gitaly-git2go/submodule_test.go | 3 | ||||
-rw-r--r-- | internal/git/gitpipe/ls_tree.go | 3 | ||||
-rw-r--r-- | internal/git/localrepo/list_entries.go (renamed from internal/git/lstree/list_entries.go) | 10 | ||||
-rw-r--r-- | internal/git/localrepo/list_entries_test.go (renamed from internal/git/lstree/list_entries_test.go) | 49 | ||||
-rw-r--r-- | internal/git/localrepo/parser.go (renamed from internal/git/lstree/parser.go) | 9 | ||||
-rw-r--r-- | internal/git/localrepo/parser_test.go (renamed from internal/git/lstree/parser_test.go) | 17 | ||||
-rw-r--r-- | internal/git/lstree/testhelper_test.go | 11 | ||||
-rw-r--r-- | internal/gitaly/service/commit/list_files.go | 3 | ||||
-rw-r--r-- | internal/gitaly/service/commit/list_last_commits_for_tree.go | 7 | ||||
-rw-r--r-- | internal/gitaly/service/commit/tree_entries.go | 9 | ||||
-rw-r--r-- | internal/gitaly/service/operations/submodules.go | 10 | ||||
-rw-r--r-- | internal/gitaly/service/operations/submodules_test.go | 3 | ||||
-rw-r--r-- | internal/gitaly/service/repository/license.go | 3 | ||||
-rw-r--r-- | internal/gitaly/service/repository/search_files.go | 4 |
14 files changed, 58 insertions, 83 deletions
diff --git a/cmd/gitaly-git2go/submodule_test.go b/cmd/gitaly-git2go/submodule_test.go index 69b278495..be35049b1 100644 --- a/cmd/gitaly-git2go/submodule_test.go +++ b/cmd/gitaly-git2go/submodule_test.go @@ -11,7 +11,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/git2go" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg" @@ -125,7 +124,7 @@ func TestSubmodule(t *testing.T) { fmt.Sprintf("%s^{tree}:", response.CommitID), tc.command.Submodule, ) - parser := lstree.NewParser(bytes.NewReader(entry), git.ObjectHashSHA1) + parser := localrepo.NewParser(bytes.NewReader(entry), git.ObjectHashSHA1) parsedEntry, err := parser.NextEntry() require.NoError(t, err) require.Equal(t, tc.command.Submodule, parsedEntry.Path) diff --git a/internal/git/gitpipe/ls_tree.go b/internal/git/gitpipe/ls_tree.go index 77c971e18..10bff12d5 100644 --- a/internal/git/gitpipe/ls_tree.go +++ b/internal/git/gitpipe/ls_tree.go @@ -9,7 +9,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" ) // lsTreeConfig is configuration for the LsTree pipeline step. @@ -97,7 +96,7 @@ func LsTree( return } - parser := lstree.NewParser(cmd, objectHash) + parser := localrepo.NewParser(cmd, objectHash) for { entry, err := parser.NextEntry() if err != nil { diff --git a/internal/git/lstree/list_entries.go b/internal/git/localrepo/list_entries.go index d5f693cb0..e5a0115a6 100644 --- a/internal/git/lstree/list_entries.go +++ b/internal/git/localrepo/list_entries.go @@ -1,4 +1,4 @@ -package lstree +package localrepo import ( "bytes" @@ -9,7 +9,6 @@ import ( "strings" "gitlab.com/gitlab-org/gitaly/v15/internal/git" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" ) var ( @@ -32,12 +31,11 @@ type ListEntriesConfig struct { // ListEntries lists tree entries for the given treeish. By default, this will do a non-recursive // listing starting from the root of the given treeish. This behaviour can be changed by passing a // config. -func ListEntries( +func (repo *Repo) ListEntries( ctx context.Context, - repo *localrepo.Repo, treeish git.Revision, cfg *ListEntriesConfig, -) ([]*localrepo.TreeEntry, error) { +) ([]*TreeEntry, error) { if cfg == nil { cfg = &ListEntriesConfig{} } @@ -71,7 +69,7 @@ func ListEntries( } parser := NewParser(cmd, objectHash) - var entries []*localrepo.TreeEntry + var entries []*TreeEntry for { entry, err := parser.NextEntry() if err != nil { diff --git a/internal/git/lstree/list_entries_test.go b/internal/git/localrepo/list_entries_test.go index a1b9a58f9..0c9c03efa 100644 --- a/internal/git/lstree/list_entries_test.go +++ b/internal/git/localrepo/list_entries_test.go @@ -1,4 +1,4 @@ -package lstree +package localrepo import ( "testing" @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg" ) @@ -20,7 +19,7 @@ func TestListEntries(t *testing.T) { repoProto, repoPath := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{ SkipCreationViaService: true, }) - repo := localrepo.NewTestRepo(t, cfg, repoProto) + repo := NewTestRepo(t, cfg, repoProto) blobID := gittest.WriteBlob(t, cfg, repoPath, []byte("blob contents")) emptyTreeID := gittest.WriteTree(t, cfg, repoPath, []gittest.TreeEntry{}) @@ -46,7 +45,7 @@ func TestListEntries(t *testing.T) { desc string treeish git.Revision cfg *ListEntriesConfig - expectedResults []*localrepo.TreeEntry + expectedResults []*TreeEntry expectedErr error }{ { @@ -56,23 +55,23 @@ func TestListEntries(t *testing.T) { { desc: "tree with blob", treeish: treeWithBlob.Revision(), - expectedResults: []*localrepo.TreeEntry{ - {Mode: "100755", Type: localrepo.Blob, OID: blobID, Path: "executable"}, - {Mode: "100644", Type: localrepo.Blob, OID: blobID, Path: "nonexecutable"}, + expectedResults: []*TreeEntry{ + {Mode: "100755", Type: Blob, OID: blobID, Path: "executable"}, + {Mode: "100644", Type: Blob, OID: blobID, Path: "nonexecutable"}, }, }, { desc: "tree with subtree", treeish: treeWithSubtree.Revision(), - expectedResults: []*localrepo.TreeEntry{ - {Mode: "040000", Type: localrepo.Tree, OID: emptyTreeID, Path: "subdir"}, + expectedResults: []*TreeEntry{ + {Mode: "040000", Type: Tree, OID: emptyTreeID, Path: "subdir"}, }, }, { desc: "nested trees", treeish: treeWithNestedSubtrees.Revision(), - expectedResults: []*localrepo.TreeEntry{ - {Mode: "040000", Type: localrepo.Tree, OID: treeWithSubtree, Path: "nested-subdir"}, + expectedResults: []*TreeEntry{ + {Mode: "040000", Type: Tree, OID: treeWithSubtree, Path: "nested-subdir"}, }, }, { @@ -81,9 +80,9 @@ func TestListEntries(t *testing.T) { cfg: &ListEntriesConfig{ Recursive: true, }, - expectedResults: []*localrepo.TreeEntry{ - {Mode: "040000", Type: localrepo.Tree, OID: treeWithSubtree, Path: "nested-subdir"}, - {Mode: "040000", Type: localrepo.Tree, OID: emptyTreeID, Path: "nested-subdir/subdir"}, + expectedResults: []*TreeEntry{ + {Mode: "040000", Type: Tree, OID: treeWithSubtree, Path: "nested-subdir"}, + {Mode: "040000", Type: Tree, OID: emptyTreeID, Path: "nested-subdir/subdir"}, }, }, { @@ -92,8 +91,8 @@ func TestListEntries(t *testing.T) { cfg: &ListEntriesConfig{ RelativePath: "nested-subdir", }, - expectedResults: []*localrepo.TreeEntry{ - {Mode: "040000", Type: localrepo.Tree, OID: emptyTreeID, Path: "subdir"}, + expectedResults: []*TreeEntry{ + {Mode: "040000", Type: Tree, OID: emptyTreeID, Path: "subdir"}, }, }, { @@ -103,10 +102,10 @@ func TestListEntries(t *testing.T) { RelativePath: "subdir", Recursive: true, }, - expectedResults: []*localrepo.TreeEntry{ - {Mode: "100644", Type: localrepo.Blob, OID: blobID, Path: "blob"}, - {Mode: "040000", Type: localrepo.Tree, OID: treeWithSubtree, Path: "subdir"}, - {Mode: "040000", Type: localrepo.Tree, OID: emptyTreeID, Path: "subdir/subdir"}, + expectedResults: []*TreeEntry{ + {Mode: "100644", Type: Blob, OID: blobID, Path: "blob"}, + {Mode: "040000", Type: Tree, OID: treeWithSubtree, Path: "subdir"}, + {Mode: "040000", Type: Tree, OID: emptyTreeID, Path: "subdir/subdir"}, }, }, { @@ -115,10 +114,10 @@ func TestListEntries(t *testing.T) { cfg: &ListEntriesConfig{ Recursive: true, }, - expectedResults: []*localrepo.TreeEntry{ - {Mode: "100644", Type: localrepo.Blob, OID: blobID, Path: "blob"}, - {Mode: "040000", Type: localrepo.Tree, OID: treeWithSubtree, Path: "subdir"}, - {Mode: "040000", Type: localrepo.Tree, OID: emptyTreeID, Path: "subdir/subdir"}, + expectedResults: []*TreeEntry{ + {Mode: "100644", Type: Blob, OID: blobID, Path: "blob"}, + {Mode: "040000", Type: Tree, OID: treeWithSubtree, Path: "subdir"}, + {Mode: "040000", Type: Tree, OID: emptyTreeID, Path: "subdir/subdir"}, }, }, { @@ -152,7 +151,7 @@ func TestListEntries(t *testing.T) { }, } { t.Run(tc.desc, func(t *testing.T) { - results, err := ListEntries(ctx, repo, tc.treeish, tc.cfg) + results, err := repo.ListEntries(ctx, tc.treeish, tc.cfg) require.Equal(t, tc.expectedErr, err) require.Equal(t, tc.expectedResults, results) }) diff --git a/internal/git/lstree/parser.go b/internal/git/localrepo/parser.go index 85d73da6a..f52b7cffe 100644 --- a/internal/git/lstree/parser.go +++ b/internal/git/localrepo/parser.go @@ -1,4 +1,4 @@ -package lstree +package localrepo import ( "bufio" @@ -7,7 +7,6 @@ import ( "io" "gitlab.com/gitlab-org/gitaly/v15/internal/git" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" ) // ErrParse is returned when the parse of an entry was unsuccessful @@ -28,7 +27,7 @@ func NewParser(src io.Reader, objectHash git.ObjectHash) *Parser { } // NextEntry reads a tree entry as it would be written by `git ls-tree -z`. -func (p *Parser) NextEntry() (*localrepo.TreeEntry, error) { +func (p *Parser) NextEntry() (*TreeEntry, error) { // Each tree entry is expected to have a format of `<mode> SP <type> SP <objectid> TAB <path> NUL`. treeEntryMode, err := p.reader.ReadBytes(' ') if err != nil { @@ -63,11 +62,11 @@ func (p *Parser) NextEntry() (*localrepo.TreeEntry, error) { return nil, err } - return &localrepo.TreeEntry{ + return &TreeEntry{ Mode: string(treeEntryMode), OID: objectID, Path: string(treeEntryPath), - Type: localrepo.ToEnum(string(treeEntryType)), + Type: ToEnum(string(treeEntryType)), }, nil } diff --git a/internal/git/lstree/parser_test.go b/internal/git/localrepo/parser_test.go index 277f42f83..24b7cf499 100644 --- a/internal/git/lstree/parser_test.go +++ b/internal/git/localrepo/parser_test.go @@ -1,4 +1,4 @@ -package lstree +package localrepo import ( "bytes" @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg" ) @@ -36,33 +35,33 @@ func TestParser(t *testing.T) { for _, tc := range []struct { desc string treeID git.ObjectID - expectedEntries localrepo.Entries + expectedEntries Entries }{ { desc: "regular entries", treeID: regularEntriesTreeID, - expectedEntries: localrepo.Entries{ + expectedEntries: Entries{ { Mode: "100644", - Type: localrepo.Blob, + Type: Blob, OID: gitignoreBlobID, Path: ".gitignore", }, { Mode: "100644", - Type: localrepo.Blob, + Type: Blob, OID: gitmodulesBlobID, Path: ".gitmodules", }, { Mode: "040000", - Type: localrepo.Tree, + Type: Tree, OID: gittest.DefaultObjectHash.EmptyTreeOID, Path: "entry with space", }, { Mode: "160000", - Type: localrepo.Submodule, + Type: Submodule, OID: submoduleCommitID, Path: "gitlab-shell", }, @@ -73,7 +72,7 @@ func TestParser(t *testing.T) { treeData := gittest.Exec(t, cfg, "-C", repoPath, "ls-tree", "-z", tc.treeID.String()) parser := NewParser(bytes.NewReader(treeData), gittest.DefaultObjectHash) - parsedEntries := localrepo.Entries{} + parsedEntries := Entries{} for { entry, err := parser.NextEntry() if err == io.EOF { diff --git a/internal/git/lstree/testhelper_test.go b/internal/git/lstree/testhelper_test.go deleted file mode 100644 index 619a98800..000000000 --- a/internal/git/lstree/testhelper_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package lstree - -import ( - "testing" - - "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" -) - -func TestMain(m *testing.M) { - testhelper.Run(m) -} diff --git a/internal/gitaly/service/commit/list_files.go b/internal/gitaly/service/commit/list_files.go index 6956e5dfe..351168a89 100644 --- a/internal/gitaly/service/commit/list_files.go +++ b/internal/gitaly/service/commit/list_files.go @@ -7,7 +7,6 @@ import ( log "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v15/internal/helper/chunk" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" @@ -86,7 +85,7 @@ func (s *server) listFiles(repo git.RepositoryExecutor, revision string, stream sender := chunk.New(&listFilesSender{stream: stream}) - for parser := lstree.NewParser(cmd, git.ObjectHashSHA1); ; { + for parser := localrepo.NewParser(cmd, git.ObjectHashSHA1); ; { entry, err := parser.NextEntry() if err == io.EOF { break diff --git a/internal/gitaly/service/commit/list_last_commits_for_tree.go b/internal/gitaly/service/commit/list_last_commits_for_tree.go index 84a9bab61..2dbc2a5de 100644 --- a/internal/gitaly/service/commit/list_last_commits_for_tree.go +++ b/internal/gitaly/service/commit/list_last_commits_for_tree.go @@ -9,7 +9,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/v15/internal/git/log" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" @@ -88,7 +87,7 @@ func (s *server) listLastCommitsForTree(in *gitalypb.ListLastCommitsForTreeReque return sendCommitsForTree(batch, stream) } -func getLSTreeEntries(parser *lstree.Parser) (localrepo.Entries, error) { +func getLSTreeEntries(parser *localrepo.Parser) (localrepo.Entries, error) { entries := localrepo.Entries{} for { @@ -109,7 +108,7 @@ func getLSTreeEntries(parser *lstree.Parser) (localrepo.Entries, error) { return entries, nil } -func (s *server) newLSTreeParser(in *gitalypb.ListLastCommitsForTreeRequest, stream gitalypb.CommitService_ListLastCommitsForTreeServer) (*command.Command, *lstree.Parser, error) { +func (s *server) newLSTreeParser(in *gitalypb.ListLastCommitsForTreeRequest, stream gitalypb.CommitService_ListLastCommitsForTreeServer) (*command.Command, *localrepo.Parser, error) { path := string(in.GetPath()) if path == "" || path == "/" { path = "." @@ -126,7 +125,7 @@ func (s *server) newLSTreeParser(in *gitalypb.ListLastCommitsForTreeRequest, str return nil, nil, err } - return cmd, lstree.NewParser(cmd, git.ObjectHashSHA1), nil + return cmd, localrepo.NewParser(cmd, git.ObjectHashSHA1), nil } func sendCommitsForTree(batch []*gitalypb.ListLastCommitsForTreeResponse_CommitForTree, stream gitalypb.CommitService_ListLastCommitsForTreeServer) error { diff --git a/internal/gitaly/service/commit/tree_entries.go b/internal/gitaly/service/commit/tree_entries.go index 3c62cfa07..5d6b5999f 100644 --- a/internal/gitaly/service/commit/tree_entries.go +++ b/internal/gitaly/service/commit/tree_entries.go @@ -13,7 +13,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v15/internal/helper/chunk" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" @@ -107,19 +106,19 @@ func (s *server) sendTreeEntries( return err } - treeEntries, err := lstree.ListEntries(ctx, repo, git.Revision(revision), &lstree.ListEntriesConfig{ + treeEntries, err := repo.ListEntries(ctx, git.Revision(revision), &localrepo.ListEntriesConfig{ Recursive: recursive, RelativePath: path, }) if err != nil { // Design wart: we do not return an error if the request does not // point to a tree object, but just return nothing. - if errors.Is(err, lstree.ErrNotTreeish) { + if errors.Is(err, localrepo.ErrNotTreeish) { return nil } // Same if we try to list tree entries of a revision which doesn't exist. - if errors.Is(err, lstree.ErrNotExist) { + if errors.Is(err, localrepo.ErrNotExist) { return nil } @@ -251,7 +250,7 @@ func toLsTreeEnum(input gitalypb.TreeEntry_EntryType) (localrepo.ObjectType, err case gitalypb.TreeEntry_BLOB: return localrepo.Blob, nil default: - return -1, lstree.ErrParse + return -1, localrepo.ErrParse } } diff --git a/internal/gitaly/service/operations/submodules.go b/internal/gitaly/service/operations/submodules.go index 0d16de468..d6e98bab5 100644 --- a/internal/gitaly/service/operations/submodules.go +++ b/internal/gitaly/service/operations/submodules.go @@ -11,7 +11,6 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/git/updateref" "gitlab.com/gitlab-org/gitaly/v15/internal/git2go" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service" @@ -73,14 +72,13 @@ func (s *Server) updateSubmodule(ctx context.Context, quarantineRepo *localrepo. // tree with the new tree abcabc. Continue iterating up the tree, // writing a new tree object each time. for { - entries, err := lstree.ListEntries( + entries, err := quarantineRepo.ListEntries( ctx, - quarantineRepo, + git.Revision("refs/heads/"+string(req.GetBranch())), - &lstree.ListEntriesConfig{ + &localrepo.ListEntriesConfig{ RelativePath: path, - }, - ) + }) if err != nil { if strings.Contains(err.Error(), "invalid object name") { return "", fmt.Errorf("submodule: %s", git2go.LegacyErrPrefixInvalidSubmodulePath) diff --git a/internal/gitaly/service/operations/submodules_test.go b/internal/gitaly/service/operations/submodules_test.go index a5aac1610..d2ec61daf 100644 --- a/internal/gitaly/service/operations/submodules_test.go +++ b/internal/gitaly/service/operations/submodules_test.go @@ -13,7 +13,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/helper/text" "gitlab.com/gitlab-org/gitaly/v15/internal/metadata/featureflag" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" @@ -732,7 +731,7 @@ func testUserUpdateSubmodule(t *testing.T, ctx context.Context) { setupData.expectedResponse.BranchUpdate.CommitId = newCommitID entry := gittest.Exec(t, cfg, "-C", repoPath, "ls-tree", "-z", fmt.Sprintf("%s^{tree}:", response.BranchUpdate.CommitId), tc.subPath) - parser := lstree.NewParser(bytes.NewReader(entry), git.ObjectHashSHA1) + parser := localrepo.NewParser(bytes.NewReader(entry), git.ObjectHashSHA1) parsedEntry, err := parser.NextEntry() require.NoError(t, err) require.Equal(t, tc.subPath, parsedEntry.Path) diff --git a/internal/gitaly/service/repository/license.go b/internal/gitaly/service/repository/license.go index cbad970cd..e791354c9 100644 --- a/internal/gitaly/service/repository/license.go +++ b/internal/gitaly/service/repository/license.go @@ -15,7 +15,6 @@ import ( "github.com/go-enry/go-license-detector/v4/licensedb/filer" "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" "gitlab.com/gitlab-org/gitaly/v15/internal/tracing" @@ -210,7 +209,7 @@ func (f *gitFiler) ReadDir(string) ([]filer.File, error) { return nil, err } - tree := lstree.NewParser(cmd, git.ObjectHashSHA1) + tree := localrepo.NewParser(cmd, git.ObjectHashSHA1) var files []filer.File for { diff --git a/internal/gitaly/service/repository/search_files.go b/internal/gitaly/service/repository/search_files.go index 11286f630..3802ffc34 100644 --- a/internal/gitaly/service/repository/search_files.go +++ b/internal/gitaly/service/repository/search_files.go @@ -9,7 +9,7 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/command" "gitlab.com/gitlab-org/gitaly/v15/internal/git" - "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" + "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" @@ -168,7 +168,7 @@ func validateSearchFilesRequest(req searchFilesRequest) error { func parseLsTree(cmd *command.Command, filter *regexp.Regexp, offset int, limit int) ([][]byte, error) { var files [][]byte var index int - parser := lstree.NewParser(cmd, git.ObjectHashSHA1) + parser := localrepo.NewParser(cmd, git.ObjectHashSHA1) for { path, err := parser.NextEntryPath() |