Skip to content

fix: add reftable HEAD migration hint#1755

Open
puneetdixit200 wants to merge 1 commit into
o2sh:mainfrom
puneetdixit200:fix-reftable-head-hint
Open

fix: add reftable HEAD migration hint#1755
puneetdixit200 wants to merge 1 commit into
o2sh:mainfrom
puneetdixit200:fix-reftable-head-hint

Conversation

@puneetdixit200
Copy link
Copy Markdown

Related to #1743.

This adds a targeted hint for the reftable placeholder failure discussed in the issue. When the commit traversal error chain shows HEAD resolving through refs/heads/.invalid or Reference name cannot start with a dot, onefetch now keeps the original error chain and adds a concrete recovery step:

git refs migrate --ref-format=files

This does not try to implement reftable support in onefetch. It just turns the current low-level gix failure into an actionable message while that support is still pending upstream.

Tests cover both the reftable-style error chain and an unrelated error that should not receive the hint.

Checks run locally:

  • rustfmt --check src/info/mod.rs
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test info::tests::test_add_reftable_head_hint --lib
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test test_display_head_refs --lib
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test --test repo test_repo -- --exact
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo clippy --lib -- -D warnings

Copy link
Copy Markdown
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would've been better to match on the gix error, so that cheap pattern and value matching could be done instead of string matching on error messages.

But overall this is good enough IMO.

Comment thread src/info/mod.rs
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