Skip to content

Commit 4727243

Browse files
committed
gitbase: use NewCommitsByHashIter to filter by commit_hash in commit_blobs table iterator
Signed-off-by: Manuel Carmona <[email protected]>
1 parent 4eb304f commit 4727243

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

commit_blobs.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (i *commitBlobsIter) NewIterator(repo *Repository) (RowRepoIter, error) {
115115
var iter object.CommitIter
116116
if len(i.repos) == 0 || stringContains(i.repos, repo.ID) {
117117
var err error
118-
iter, err = repo.Repo.CommitObjects()
118+
iter, err = NewCommitsByHashIter(repo, i.commits)
119119
if err != nil {
120120
return nil, err
121121
}
@@ -145,10 +145,6 @@ func (i *commitBlobsIter) Next() (sql.Row, error) {
145145
return nil, err
146146
}
147147

148-
if len(i.commits) > 0 && !stringContains(i.commits, commit.Hash.String()) {
149-
continue
150-
}
151-
152148
filesIter, err := commit.Files()
153149
if err != nil {
154150
if i.skipGitErrors {

commits.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ func (r *commitsTable) WithProjectAndFilters(
9090
ctx, CommitsSchema, CommitsTableName, filters,
9191
[]string{"commit_hash"},
9292
func(selectors selectors) (RowRepoIter, error) {
93-
if len(selectors["commit_hash"]) == 0 {
94-
return new(commitIter), nil
95-
}
96-
9793
hashes, err := selectors.textValues("commit_hash")
9894
if err != nil {
9995
return nil, err

0 commit comments

Comments
 (0)