@@ -202,12 +202,20 @@ func (impl RepoManagerImpl) updatePipelineMaterialCommit(gitCtx git.GitContext,
202
202
203
203
fetchCount := impl .configuration .GitHistoryCount
204
204
var repository * git.GitRepository
205
- commits , _ , _ , err := impl .repositoryManager .ChangesSinceByRepository (gitCtx , repository , pipelineMaterial .Value , "" , "" , fetchCount , material .CheckoutLocation , true )
205
+ commits , _ , errMsg , err := impl .repositoryManager .ChangesSinceByRepository (gitCtx , repository , pipelineMaterial .Value , "" , "" , fetchCount , material .CheckoutLocation , true )
206
206
//commits, err := impl.FetchChanges(pipelineMaterial.Id, "", "", 0)
207
207
if gitCtx .Err () != nil {
208
208
impl .logger .Errorw ("context error in getting commits" , "err" , gitCtx .Err ())
209
209
return gitCtx .Err ()
210
- } else if err == nil {
210
+ } else if err != nil {
211
+ pipelineMaterial .Errored = true
212
+ if errMsg != "" {
213
+ pipelineMaterial .ErrorMsg = errMsg
214
+ } else {
215
+ pipelineMaterial .ErrorMsg = err .Error ()
216
+ }
217
+ pipelineMaterial .LastSeenHash = ""
218
+ } else {
211
219
impl .logger .Infow ("commits found" , "commit" , commits )
212
220
b , err := json .Marshal (commits )
213
221
if err == nil {
@@ -223,13 +231,13 @@ func (impl RepoManagerImpl) updatePipelineMaterialCommit(gitCtx git.GitContext,
223
231
pipelineMaterial .ErrorMsg = ""
224
232
} else {
225
233
pipelineMaterial .Errored = true
226
- pipelineMaterial .ErrorMsg = err .Error ()
234
+ if errMsg != "" {
235
+ pipelineMaterial .ErrorMsg = errMsg
236
+ } else {
237
+ pipelineMaterial .ErrorMsg = err .Error ()
238
+ }
227
239
pipelineMaterial .LastSeenHash = ""
228
240
}
229
- } else {
230
- pipelineMaterial .Errored = true
231
- pipelineMaterial .ErrorMsg = err .Error ()
232
- pipelineMaterial .LastSeenHash = ""
233
241
}
234
242
materialCommits = append (materialCommits , pipelineMaterial )
235
243
}
0 commit comments