From 32a3931d9de3782cc9f353df5e60cb29d006def5 Mon Sep 17 00:00:00 2001 From: bkellam Date: Mon, 8 Sep 2025 15:56:20 -0400 Subject: [PATCH 1/2] Explicitly set refspec on git fetch --- packages/backend/src/git.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/backend/src/git.ts b/packages/backend/src/git.ts index 56cc0f29d..97b6e5883 100644 --- a/packages/backend/src/git.ts +++ b/packages/backend/src/git.ts @@ -27,10 +27,6 @@ export const cloneRepository = async ( ); await unsetGitConfig(path, ["remote.origin.url"]); - - await git.cwd({ - path, - }).addConfig("remote.origin.fetch", "+refs/heads/*:refs/heads/*"); } catch (error: unknown) { const baseLog = `Failed to clone repository: ${path}`; @@ -59,6 +55,7 @@ export const fetchRepository = async ( await git.fetch([ remoteUrl.toString(), + "+refs/heads/*:refs/heads/*", "--prune", "--progress" ]); From dc464d5ec2dfa0e113424c2e213aaca3b10d5164 Mon Sep 17 00:00:00 2001 From: bkellam Date: Mon, 8 Sep 2025 16:15:33 -0400 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57300ae29..848296324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Fixed "couldn't find remote ref HEAD" errors when re-indexing certain repositories. [#497](https://github.com/sourcebot-dev/sourcebot/pull/497) + ### Changed - Disable page scroll when using arrow keys on search suggestions box. [#493](https://github.com/sourcebot-dev/sourcebot/pull/493)