Skip to content

fix: keep sidecar cleanup in the selected mirror directory - #262

Merged
vincentkoc merged 1 commit into
mainfrom
fix/mirror-cleanup-root
Nov 19, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/mirror-cleanup-root

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

SQLite sidecar cleanup of a mirror directory named share cleans share instead. 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 .git exclusions 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 tidy
  • git diff --exit-code -- go.mod go.sum
  • GOWORK=off go vet ./...
  • GOWORK=off go test -count=1 ./...
  • git diff --check
  • Reviewed candidate: cbb667601d2c312a12b7fdf62f35663b90343784
  • Base: 21a6d44f40e3a22cec21a45016e04b7036c0f5df

@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc marked this pull request as ready for review November 19, 2026 17:35
@vincentkoc
vincentkoc force-pushed the fix/mirror-cleanup-root branch from 771eb73 to cbb6676 Compare November 19, 2026 17:40
@vincentkoc
vincentkoc merged commit c0f2e1c into main Nov 19, 2026
8 checks passed
@vincentkoc
vincentkoc deleted the fix/mirror-cleanup-root branch November 19, 2026 17:43
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.

1 participant