Skip to content

Fix panic when search yields repo and file matches in same repo

Warren Gifford requested to merge mrn/fix-uninitialized-map into main

Created by: mrnugget

This fixes #382 (closed) by fixing a regression that was introduced by #361.

When the search queries defined in a campaign spec yielded a repository match result and file match results in the same repository, in that order, the code would crash because of an uninitialized map.

The code here fixes it by always initializing the map.

I also added a test that reproduces the behaviour and documents how we turn multiple search results into a list of repositories.

Merge request reports

Loading