mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +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]
|
||||
|
||||
### 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
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -18,14 +18,19 @@ export const cloneRepository = async (
|
|||
path,
|
||||
})
|
||||
|
||||
await git.init(/*bare = */ true);
|
||||
|
||||
await git.fetch([
|
||||
await git.clone(
|
||||
remoteUrl.toString(),
|
||||
// See https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
|
||||
"+refs/heads/*:refs/heads/*",
|
||||
"--progress",
|
||||
]);
|
||||
path,
|
||||
[
|
||||
"--bare",
|
||||
]
|
||||
);
|
||||
|
||||
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}`;
|
||||
|
||||
|
|
@ -54,7 +59,6 @@ export const fetchRepository = async (
|
|||
|
||||
await git.fetch([
|
||||
remoteUrl.toString(),
|
||||
"+refs/heads/*:refs/heads/*",
|
||||
"--prune",
|
||||
"--progress"
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue