🐛 fix(vscode): worktreePath 消费侧统一解析 ~/绝对/相对,修复带 ~ 的存量工单与绝对路径 worktree 误判
新增 resolveWorktreePath(stored, workspaceRoot) 三态合一解析:开头 ~ 展开为 home、 已是绝对原样、相对拼到 workspaceRoot。替换全部消费点,原先「判 isAbsolute 再 join」 不认 ~、issueLoader 算 worktreeExists 更是裸 join 连绝对路径都拼坏。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
import * as fs from 'node:fs'
|
||||
import * as path from 'node:path'
|
||||
import { resolveWorktreePath } from '../git/worktree'
|
||||
import type { GiteaComment, GiteaIssue } from './api'
|
||||
import type { Issue, IssueColumn } from './types'
|
||||
import {
|
||||
@@ -354,7 +355,7 @@ async function buildIssue(opts: {
|
||||
let worktreeExists: boolean | undefined
|
||||
if (worktreePath && workspaceRoot) {
|
||||
try {
|
||||
worktreeExists = fs.existsSync(path.join(workspaceRoot, worktreePath))
|
||||
worktreeExists = fs.existsSync(resolveWorktreePath(worktreePath, workspaceRoot))
|
||||
}
|
||||
catch {
|
||||
worktreeExists = false
|
||||
|
||||
Reference in New Issue
Block a user