Skip to content

git: make bad-tag recovery test deterministic - #368

Open
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/350-bad-tag-test-portability
Open

git: make bad-tag recovery test deterministic#368
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/350-bad-tag-test-portability

Conversation

@OllieinCanada

Copy link
Copy Markdown
Contributor

Fixes #350

Summary

Make the bad-tag recovery regression test deterministic across Git versions.

Root cause

The previous test depended on git fetch --prune --no-tags failing after a
corrupt local tag was created. Git 2.25.1 completes that fetch successfully
without inspecting or removing the tag, so Sashiko's recovery branch was never
entered and the assertion failed.

Changes

  • extract the existing bad-tag deletion step into a private helper
  • keep the production fetch and retry behavior unchanged
  • invoke the recovery helper with the precise Git diagnostic in the test
  • remove the unnecessary remote repository and version-dependent fetch setup

Validation

  • reproduced the original failure with Git 2.25.1
  • focused bad-tag recovery test passes
  • all six git_ops tests pass
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features --release -- -D warnings
  • cargo test --release
  • git diff --check
  • make check-pr

Signed-off-by: OllieinCanada <73385593+OllieinCanada@users.noreply.github.com>
@OllieinCanada
OllieinCanada marked this pull request as ready for review July 24, 2026 17:27
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.

tests: make bad-tag recovery test portable across Git versions

1 participant