File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Fixed
11+ - Fixed issue where searching for refs/heads/<default_branch> would return no matches. [ #809 ] ( https://github.com/sourcebot-dev/sourcebot/pull/809 )
12+
1013## [ 4.10.19] - 2026-01-28
1114
1215### Fixed
Original file line number Diff line number Diff line change @@ -397,7 +397,12 @@ export class RepoIndexManager {
397397 path : repoPath ,
398398 } ) ;
399399
400- let revisions = defaultBranch ? [ defaultBranch ] : [ 'HEAD' ] ;
400+ // Ensure defaultBranch has refs/heads/ prefix for consistent searching
401+ const defaultBranchWithPrefix = defaultBranch && ! defaultBranch . startsWith ( 'refs/' )
402+ ? `refs/heads/${ defaultBranch } `
403+ : defaultBranch ;
404+
405+ let revisions = defaultBranchWithPrefix ? [ defaultBranchWithPrefix ] : [ 'HEAD' ] ;
401406
402407 if ( metadata . branches ) {
403408 const branchGlobs = metadata . branches
@@ -427,6 +432,9 @@ export class RepoIndexManager {
427432 ] ;
428433 }
429434
435+ // De-duplicate revisions to ensure we don't have duplicate branches/tags
436+ revisions = [ ...new Set ( revisions ) ] ;
437+
430438 // zoekt has a limit of 64 branches/tags to index.
431439 if ( revisions . length > 64 ) {
432440 logger . warn ( `Too many revisions (${ revisions . length } ) for repo ${ repo . id } , truncating to 64` ) ;
You can’t perform that action at this time.
0 commit comments