Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/plugins/gitextractor/tasks/repo_cloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var CloneGitRepoMeta = plugin.SubTaskMeta{
func CloneGitRepo(subTaskCtx plugin.SubTaskContext) errors.Error {
taskData, ok := subTaskCtx.GetData().(*parser.GitExtractorTaskData)
if !ok {
panic("git repo reference not found on context")
subTaskCtx.GetLogger().Error(nil, "git repo reference not found on context")
return errors.Default.New("git repo reference not found on context")
}
op := taskData.Options
storage := store.NewDatabase(subTaskCtx, op.RepoId)
Expand Down
6 changes: 4 additions & 2 deletions backend/plugins/gitextractor/tasks/repo_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ func CollectGitDiffLines(subTaskCtx plugin.SubTaskContext) errors.Error {
func getGitRepo(subTaskCtx plugin.SubTaskContext) parser.RepoCollector {
taskData, ok := subTaskCtx.GetData().(*parser.GitExtractorTaskData)
if !ok {
panic("git repo reference not found on context")
subTaskCtx.GetLogger().Error(nil, "git repo reference not found on context")
return nil
}
if taskData.GitRepo == nil {
panic("git repo is empty, please check subtask: clone repo")
subTaskCtx.GetLogger().Error(nil, "git repo is empty, skipping Collect Commits subtask")
return nil
}
return taskData.GitRepo
}
Expand Down