Skip to content

fix(core): read git 2.55's quoted -L paths and keep the partial-clone hint - #9

Merged
RutaTang merged 1 commit into
mainfrom
claude/relaxed-cori-bw7sku
Sep 30, 2026
Merged

RutaTang merged 1 commit into
mainfrom
claude/relaxed-cori-bw7sku

Conversation

@RutaTang

Copy link
Copy Markdown
Owner

Summary

Two clew-core git tests have been red on main since the GitHub runners moved to git 2.55.0 (both the Linux and macOS test jobs). Both are the product's, reproduced with a local build of git 2.55.0 and fixed in crates/clew-core/src/git.rs:

  • log -L paths are quoted now. git 2.55 prints historical paths in the standard C-quoted form, and a name containing a space ends its ---/+++ label with a tab (git's diff.c), which the header decoder did not strip. The quoted name then failed to unquote, the record was undecodable, and that step vanished from a symbol's history (a_newline_in_a_historical_path_neither_splits_nor_relabels_records). standard_header_path now drops the trailing tab before unquoting; a name never ends in one itself, since a raw tab is always quoted.

  • The partial-clone hint keyed on git's wording. It looked for "could not fetch <oid> from promisor remote", which 2.55 no longer prints for a cat-file (it says "bad file", as for a corrupt repository; show, log -L and rev-parse moved to their own words). The runner now decides: when a command fails over a missing object (names_a_missing_object), it asks the repository whether it names a promisor remote (remote.<name>.promisor or extensions.partialClone), and GitError::Failed carries the answer in a new partial_clone field. A corrupt repository is not called a partial clone, and the probe runs only on such failures, so the normal path spawns nothing extra (a_partial_clone_never_fetches_through_its_remote).

No fetch was ever attempted under 2.55 either (GIT_NO_LAZY_FETCH still holds); only the message had lost its explanation.

Tests

  • The decoder test gains the tabbed labels, quoted and unquoted.
  • A unit test pins the hint's rule: the field earns it, the old "promisor remote" wording still does, a bare "bad file" does not.

Verification

Check Result
git:: tests under git 2.55.0 (local build) 39 passed
git:: tests under git 2.43.0 39 passed
scripts/hermetic-test.sh for core, server, protocol under git 2.55.0 809 passed, 0 failed
cargo clippy --all-targets -- -D warnings (core, server) 0 warnings
cargo doc --document-private-items with -D warnings (core, server) passes
cargo fmt --all -- --check passes

🤖 Generated with Claude Code

https://claude.ai/code/session_01WRJ4sDknvQJ86tFvGydgpf


Generated by Claude Code

… hint

Two tests went red on CI when the runners moved to git 2.55.0, and both
were the product's, reproduced with a local build of that git:

- `log -L` now prints historical paths in the standard quoted form, and a
  name with a space ends its `---`/`+++` label with a tab (diff.c), which
  the header decoder did not strip: the quoted name then failed to unquote,
  the record was undecodable, and the step vanished from a symbol's
  history. The tab is dropped before unquoting; a name never ends in one.

- The partial-clone hint keyed on git's wording, "could not fetch <oid>
  from promisor remote", which 2.55 no longer prints for a cat-file (it
  says "bad file", as for a corrupt repository; other commands moved to
  their own words). The runner now decides: when a command fails over a
  missing object, it asks the repository whether it names a promisor
  remote, and `GitError::Failed` carries the answer. A corrupt repository
  is not called a partial clone, and the probe runs only on such failures.

`names_a_missing_object` lists the wordings; the decoder test covers the
tabbed labels, quoted and not, and a unit test the hint's rule. The git
suite passes under 2.43 and 2.55.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRJ4sDknvQJ86tFvGydgpf
@RutaTang
RutaTang merged commit 8f9d2be into main Sep 30, 2026
6 checks passed
@RutaTang
RutaTang deleted the claude/relaxed-cori-bw7sku branch September 30, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants