Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Fixed issue where searching for refs/heads/<default_branch> would return no matches. [#809](https://github.com/sourcebot-dev/sourcebot/pull/809)

## [4.10.19] - 2026-01-28

### Fixed
Expand Down
10 changes: 9 additions & 1 deletion packages/backend/src/repoIndexManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,12 @@ export class RepoIndexManager {
path: repoPath,
});

let revisions = defaultBranch ? [defaultBranch] : ['HEAD'];
// Ensure defaultBranch has refs/heads/ prefix for consistent searching
const defaultBranchWithPrefix = defaultBranch && !defaultBranch.startsWith('refs/')
? `refs/heads/${defaultBranch}`
: defaultBranch;

let revisions = defaultBranchWithPrefix ? [defaultBranchWithPrefix] : ['HEAD'];

if (metadata.branches) {
const branchGlobs = metadata.branches
Expand Down Expand Up @@ -427,6 +432,9 @@ export class RepoIndexManager {
];
}

// De-duplicate revisions to ensure we don't have duplicate branches/tags
revisions = [...new Set(revisions)];

// zoekt has a limit of 64 branches/tags to index.
if (revisions.length > 64) {
logger.warn(`Too many revisions (${revisions.length}) for repo ${repo.id}, truncating to 64`);
Expand Down