Skip to content

search: use the searched repo in new commit search

Administrator requested to merge k/commit-search into main

Created by: keegancsmith

We close over repoRev in the onMatches closure below. However, repoRev is a loop variable, so is changed on each loop. This meant in practice we always reported the last repo in "j.Repos" as the matched repository. We pull repoRev into the loop body scope to copy it each iteration.

Test Plan: Locally ran "type:diff foobar". This had results in multiple repos.

  1. no feature flag :: correct
  2. feature flag :: incorrect - all results in same repo
  3. apply this commit :: correct

Fixes https://github.com/sourcegraph/sourcegraph/issues/26344

Merge request reports

Loading