Repository navigation
fix(worktree): incarnation 状态迁至 userData,不再污染用户项目目录 - #255
Merged
Merged
Conversation
原实现把 .pier/worktree-incarnations.json 写进打开工作区的 git 主根,在非 Pier 项目里留下 untracked 目录。改为持久化到 userData 下按主仓库 sha256 分片,生产经 wireWorktreeService 注入 userData 根目录,测试与降级走进程内内存。保留旧 .pier 路径的 gitignore 防御,避免 contributor 残留旧文件变 dirty。 Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
问题
Pier 把 worktree incarnation 注册表写在打开工作区的 git 主根(
.pier/worktree-incarnations.json)。在非 Pier 项目里打开仓库会留下一个 untracked.pier/目录,污染用户仓库状态。改动
userData/worktree-incarnations/<sha256(mainPath)>.json,按主仓库分片。wireWorktreeService(userDataDir, readPreferences)注入 userData 根目录;测试与无法落盘时仍走进程内 Map。.gitignore对旧.pier/worktree-incarnations.json的忽略,避免 contributor 残留旧文件显示为 dirty。验证
pnpm preflight:ci本地绿(exit 0)。tests/unit/main/git/worktree-incarnation.test.ts覆盖 userData 分片路径、缺省 storeRootDir 内存降级与旧路径不再写盘。