Summary
git_ops::tests::test_ensure_remote_bad_tag_recovery fails consistently with
Git 2.25.1 because git fetch --prune --no-tags succeeds without inspecting or
removing the deliberately corrupt local tag.
The recovery logic is entered only when fetch fails with stderr containing
fatal: bad object refs/tags/. On this Git version that diagnostic is not
produced, so ensure_remote() returns successfully while
.git/refs/tags/bad-tag remains and the final assertion fails.
Reproduction
On current main at 8ac8e51fd79c8560404efe62d0c9ce38defce5af:
cargo test --release --lib \
git_ops::tests::test_ensure_remote_bad_tag_recovery -- --exact
Result:
test git_ops::tests::test_ensure_remote_bad_tag_recovery ... FAILED
Bad tag should have been deleted by recovery logic
The failure also causes make check-pr to fail locally.
Environment
- Rust 1.90.0
- Git 2.25.1
- WSL Ubuntu
Expected behavior
The test should deterministically exercise the recovery path across supported
Git versions, or the repository should document and enforce a minimum Git
version that produces the expected fetch failure.
This was discovered while validating an unrelated NNTP whitespace fix. That
change does not modify src/git_ops.rs, and the failure reproduces when this
test is run alone.
Summary
git_ops::tests::test_ensure_remote_bad_tag_recoveryfails consistently withGit 2.25.1 because
git fetch --prune --no-tagssucceeds without inspecting orremoving the deliberately corrupt local tag.
The recovery logic is entered only when fetch fails with stderr containing
fatal: bad object refs/tags/. On this Git version that diagnostic is notproduced, so
ensure_remote()returns successfully while.git/refs/tags/bad-tagremains and the final assertion fails.Reproduction
On current
mainat8ac8e51fd79c8560404efe62d0c9ce38defce5af:Result:
The failure also causes
make check-prto fail locally.Environment
Expected behavior
The test should deterministically exercise the recovery path across supported
Git versions, or the repository should document and enforce a minimum Git
version that produces the expected fetch failure.
This was discovered while validating an unrelated NNTP whitespace fix. That
change does not modify
src/git_ops.rs, and the failure reproduces when thistest is run alone.