Fix search behavior and tests for bare repos.