Files
MooTool/next-compose/docs/diff/442-git-filediffs-electron-vaultgit-parity.md
RememBerBerandCursor c834db2a83 feat(next-compose): 对照 Electron 落地 F00–F25 与 A01–A03 主体能力
将 Vault/Git/MCP/AI、壳层主题密度、25 工具真实闭环与 desktopTest 638 项及 DIFF-065–471 文档/证据一并纳入仓库,便于持续对齐验收;产品窗 IME/冲突与三平台发行仍待验。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:51:45 +08:00

1007 B
Raw Permalink Blame History

DIFF-442:GitEngine.fileDiffs 路径规则 + Electron vaultGitService 对照单测

背景

Electron VaultGitService.diff 对非法路径抛 Invalid Git path,对已指定但工作区无对应变更的路径返回空 files。Compose fileDiffs 曾把 ../outside 当成「全部变更」,并对无 porcelain 项的路径合成 HEAD↔工作区 diff,与 Electron 不一致。

行为

  • path 非空但 normalizeGitPath 失败 → IllegalArgumentException("Invalid Git path")(VaultGitDialog 已有 toast 捕获)。
  • path 合法但 status.changes 无匹配项 → 空列表(对齐 valid..name.json 用例)。
  • 新增 GitEngineTest:fileDiffsMatchesElectronPathRules、automaticCheckpointInitializesRepositoryOnFirstUse、automaticCheckpointPushesWhenRemoteConfigured、unicodePathsWorkForStatusDiffDiscardAndRename;加强嵌套 Vault 初始化不吞父仓未跟踪文件。

验证

  • ./gradlew :composeApp:desktopTest --offline(574/574)