Skip to content

Commit b05fc7a

Browse files
fix(backend): Explicitly set refspec on fetch (#497)
1 parent 2309b67 commit b05fc7a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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 "couldn't find remote ref HEAD" errors when re-indexing certain repositories. [#497](https://github.com/sourcebot-dev/sourcebot/pull/497)
12+
1013
### Changed
1114
- Disable page scroll when using arrow keys on search suggestions box. [#493](https://github.com/sourcebot-dev/sourcebot/pull/493)
1215

packages/backend/src/git.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ export const cloneRepository = async (
2727
);
2828

2929
await unsetGitConfig(path, ["remote.origin.url"]);
30-
31-
await git.cwd({
32-
path,
33-
}).addConfig("remote.origin.fetch", "+refs/heads/*:refs/heads/*");
3430
} catch (error: unknown) {
3531
const baseLog = `Failed to clone repository: ${path}`;
3632

@@ -59,6 +55,7 @@ export const fetchRepository = async (
5955

6056
await git.fetch([
6157
remoteUrl.toString(),
58+
"+refs/heads/*:refs/heads/*",
6259
"--prune",
6360
"--progress"
6461
]);

0 commit comments

Comments
 (0)