🐛 fix(vscode): 摘修复列表与角标认 cherry-pick -x 尾注,解过冲突的复制品不再重复显示

解过冲突的 cherry-pick 复制品补丁内容已变,按文件指纹对不上,列表和角标
都把它当没摘。现在额外扫发布分支独有提交的说明,`(cherry picked from
commit <sha>)` 尾注命中的来源提交直接判已摘,列表过滤与 rev-list 计数同步扣掉。

Claude-Session: https://claude.ai/code/session_018HDxMmNDyfLa3bMTUctBzt
This commit is contained in:
cruldra committed 2026-09-06 13:55:28 +08:00
1 parent e99aed15c2
commit df0660cff7
4 files changed
+42 -9

No files matched your search

+18
View File
@@ -201,6 +201,24 @@ describe('集成', () => {
const list = await listUnreleasedCommits({ cwd: fx.repo, devBranch: 'main', current: 'release/2026-08-31' })
expect(list.map(c => c.subject)).toEqual(['feat: other'])
})
it('解过冲突的复制品内容不同,但带 -x 尾注就算已摘,角标计数同步扣掉', async () => {
fx = await setup()
await cutRelease({ cwd: fx.repo, devBranch: 'main', branch: 'release/2026-08-31' })
const fix = commit(fx.peer, 'a.txt', 'a2', 'fix a')
commit(fx.peer, 'c.txt', 'c', 'feat: other')
git(fx.peer, ['push', 'origin', 'main'])
git(fx.peer, ['fetch'])
git(fx.peer, ['checkout', '-b', 'release/2026-08-31', 'origin/release/2026-08-31'])
writeFileSync(path.join(fx.peer, 'a.txt'), 'a2 resolved differently\n')
git(fx.peer, ['add', 'a.txt'])
git(fx.peer, ['commit', '-m', `fix a\n\n(cherry picked from commit ${fix})`])
git(fx.peer, ['push', 'origin', 'release/2026-08-31'])
git(fx.repo, ['fetch', 'origin'])
const list = await listUnreleasedCommits({ cwd: fx.repo, devBranch: 'main', current: 'release/2026-08-31' })
expect(list.map(c => c.subject)).toEqual(['feat: other'])
const s = await getReleaseStatus({ cwd: fx.repo, devBranch: 'main', prefix: 'release/' })
expect(s.unreleased).toBe(1)
})
it('标题相同但改的文件不同,仍算未发布', async () => {
fx = await setup()
await cutRelease({ cwd: fx.repo, devBranch: 'main', branch: 'release/2026-08-31' })