File tree Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,15 @@ func (commitBlobsTable) WithProjectAndFilters(
78
78
return nil , err
79
79
}
80
80
81
+ s , ok := ctx .Session .(* Session )
82
+ if ! ok {
83
+ return nil , ErrInvalidGitbaseSession .New (ctx .Session )
84
+ }
85
+
81
86
return & commitBlobsIter {
82
- repos : repos ,
83
- commits : commits ,
87
+ repos : repos ,
88
+ commits : commits ,
89
+ skipGitErrors : s .SkipGitErrors ,
84
90
}, nil
85
91
},
86
92
)
@@ -94,10 +100,11 @@ func (commitBlobsTable) WithProjectAndFilters(
94
100
}
95
101
96
102
type commitBlobsIter struct {
97
- repoID string
98
- iter object.CommitIter
99
- currCommit * object.Commit
100
- filesIter * object.FileIter
103
+ repoID string
104
+ iter object.CommitIter
105
+ currCommit * object.Commit
106
+ filesIter * object.FileIter
107
+ skipGitErrors bool
101
108
102
109
// selectors for faster filtering
103
110
repos []string
@@ -131,6 +138,10 @@ func (i *commitBlobsIter) Next() (sql.Row, error) {
131
138
if i .currCommit == nil {
132
139
commit , err := i .iter .Next ()
133
140
if err != nil {
141
+ if err != io .EOF && i .skipGitErrors {
142
+ continue
143
+ }
144
+
134
145
return nil , err
135
146
}
136
147
@@ -140,6 +151,10 @@ func (i *commitBlobsIter) Next() (sql.Row, error) {
140
151
141
152
filesIter , err := commit .Files ()
142
153
if err != nil {
154
+ if i .skipGitErrors {
155
+ continue
156
+ }
157
+
143
158
return nil , err
144
159
}
145
160
@@ -156,6 +171,10 @@ func (i *commitBlobsIter) Next() (sql.Row, error) {
156
171
continue
157
172
}
158
173
174
+ if i .skipGitErrors {
175
+ continue
176
+ }
177
+
159
178
return nil , err
160
179
}
161
180
You can’t perform that action at this time.
0 commit comments