Repository navigation
http-fetch: reuse completed packs before downloading - #148
dreynaud-oai wants to merge 1 commit into
Conversation
A packfile URI can name a pack that is already installed locally. We still download that pack because http-fetch only looks for a partial download. Open objects/pack/pack-<hash>.pack before starting HTTP. If we can open it, feed it to the requested index-pack command and report zero downloaded bytes. This preserves pack validation, index-pack output and keep-file handling while avoiding a second download. Signed-off-by: Daniel Reynaud <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92f766d7fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| report_packfile_progress(&progress); | ||
| if (run_command(&ip)) | ||
| die("index-pack failed for existing pack"); | ||
| return; |
There was a problem hiding this comment.
Clean up stale partial packs before returning
When a completed pack coexists with pack-<hash>.pack.temp—for example, after an interrupted download followed by another process installing the pack, or a crash after index-pack succeeds—the early return permanently bypasses the cleanup performed by finish_http_pack_request(). Every later invocation takes this branch as well, so a potentially multi-gigabyte partial remains in the object directory indefinitely; remove the obsolete temporary file after the existing pack has been successfully validated.
Useful? React with 👍 / 👎.
|
Superseded by #149 on dr/codex/reuse-packfile-uri. The commit is unchanged. |
No description provided.