fix: syncDirectory same-path guard, nested .git exclusion, and sync stash handling #356
Reference in New Issue
Block a user
Delete Branch "fix/idempotent-init"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #355
Two runtime bugs discovered after merging the idempotent init PR.
Bug 1:
mosaic wizard— EACCES on same-path sync (file-ops.ts)Cause:
syncDirectorycalled wheresourceDir === mosaicHome. It copied every file onto itself; git pack files are read-only (0444), socopyFileSyncfails.Also:
excludeGitonly matched top-level.git— nested dirs likesources/agent-skills/.gitwere still traversed.Fix (
packages/mosaic/src/platform/file-ops.ts):resolve(source) === resolve(target).gitdirs at any depth (not just top-level).git/pathsTests (
packages/mosaic/__tests__/platform/file-ops.test.ts):.gitexclusion.gitcopied whenexcludeGit: falseBug 2:
mosaic sync— dirty worktree breaks pull (mosaic-sync-skills)Cause: Bare
git pull --rebasewith no dirty-tree handling.Fix (
packages/mosaic/framework/tools/_scripts/mosaic-sync-skills):git diff --quietTesting
@mosaic/mosaicbumped to0.0.3-1