mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
fix(worker): Fix "attempting to index 0 total files" zoekt issue (#488)
This commit is contained in:
parent
e31740773e
commit
d694330998
2 changed files with 15 additions and 8 deletions
|
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix issue where zoekt was failing to index repositories due to `HEAD` pointing to a branch that does not exist. [#488](https://github.com/sourcebot-dev/sourcebot/pull/488)
|
||||||
|
|
||||||
## [4.6.5] - 2025-09-02
|
## [4.6.5] - 2025-09-02
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,19 @@ export const cloneRepository = async (
|
||||||
path,
|
path,
|
||||||
})
|
})
|
||||||
|
|
||||||
await git.init(/*bare = */ true);
|
await git.clone(
|
||||||
|
|
||||||
await git.fetch([
|
|
||||||
remoteUrl.toString(),
|
remoteUrl.toString(),
|
||||||
// See https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
|
path,
|
||||||
"+refs/heads/*:refs/heads/*",
|
[
|
||||||
"--progress",
|
"--bare",
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
await unsetGitConfig(path, ["remote.origin.url"]);
|
||||||
|
|
||||||
|
await git.cwd({
|
||||||
|
path,
|
||||||
|
}).addConfig("remote.origin.fetch", "+refs/heads/*:refs/heads/*");
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const baseLog = `Failed to clone repository: ${path}`;
|
const baseLog = `Failed to clone repository: ${path}`;
|
||||||
|
|
||||||
|
|
@ -54,7 +59,6 @@ export const fetchRepository = async (
|
||||||
|
|
||||||
await git.fetch([
|
await git.fetch([
|
||||||
remoteUrl.toString(),
|
remoteUrl.toString(),
|
||||||
"+refs/heads/*:refs/heads/*",
|
|
||||||
"--prune",
|
"--prune",
|
||||||
"--progress"
|
"--progress"
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue