Repository navigation
fix: keep sidecar cleanup in the selected mirror directory - #262
Merged
Merged
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
vincentkoc
marked this pull request as ready for review
November 19, 2026 17:35
vincentkoc
force-pushed
the
fix/mirror-cleanup-root
branch
from
November 19, 2026 17:40
771eb73 to
cbb6676
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
SQLite sidecar cleanup of a mirror directory named
sharecleansshareinstead. It deletes WAL/SHM files from the neighboring directory and leaves the selected mirror untouched. Trailing spaces have the same effect on filesystems that preserve them.User Impact
Cleanup now removes sidecars beneath the exact supplied root. Empty or whitespace-only roots are still rejected. Existing sidecar matching and
.gitexclusions are unchanged.Why This Change Was Made
Use trimming only to check for blank input, without rewriting the path passed to the directory walker.
Evidence
Both leading- and trailing-space regression cases failed on macOS before the fix: the selected sidecar survived and the neighboring sidecar disappeared. They now pass, verifying the selected file is removed and the neighbor retains its exact bytes. The leading-space case also runs on Windows; trailing-space coverage is skipped there because Win32 aliases those names.
Local library validation passed. Independent native review and re-review after a changelog-only rebase found no P0–P3 issues. The cleanup regression suite passed again after rebasing. gitcrawl calls this cleanup helper.
Validation details
GOWORK=off go test -count=1 ./mirror -run '^TestCleanSQLiteSidecars'GOWORK=off go mod tidygit diff --exit-code -- go.mod go.sumGOWORK=off go vet ./...GOWORK=off go test -count=1 ./...git diff --checkcbb667601d2c312a12b7fdf62f35663b9034378421a6d44f40e3a22cec21a45016e04b7036c0f5df