Move Github comments check to fix a test #1927

This commit is contained in:
Cody Rose 2023-10-19 19:23:55 -04:00 committed by GitHub
parent 4b821e9732
commit 7ac7fa8728
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1151,10 +1151,6 @@ type repoInfo struct {
}
func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimmedURL []string, repoURL *url.URL, chunksChan chan *sources.Chunk) error {
if !(s.includeIssueComments || s.includePRComments) {
return nil
}
// Normal repository URL (https://github.com/<owner>/<repo>).
if len(trimmedURL) < 3 {
return fmt.Errorf("url missing owner and/or repo: '%s'", repoURL.String())
@ -1162,6 +1158,10 @@ func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimm
owner := trimmedURL[1]
repo := trimmedURL[2]
if !(s.includeIssueComments || s.includePRComments) {
return nil
}
repoInfo := repoInfo{
owner: owner,
repo: repo,