fix: 修复 WSL 会话 Linux 路径解析 (#399)
This commit is contained in:
committed by
Menghuan1918
parent
dde0923980
commit
180b16de1b
+2
-1
@@ -30,6 +30,7 @@ import {
|
||||
type SidebarPrefs,
|
||||
} from './config.ts'
|
||||
import { parentOf, requireAbsolute, listDirectory, rootLabel } from './fs-tree.ts'
|
||||
import { resolveSessionPath } from './session-path.ts'
|
||||
import { writeWorkspaceUpload } from './fs-operations.ts'
|
||||
import { ensureWorkspacePath, ensureWorkspaceWritePath } from './path-security.ts'
|
||||
import { searchFiles } from './fs-search.ts'
|
||||
@@ -156,7 +157,7 @@ function selectedRepoOf(payload: unknown): string | undefined {
|
||||
* cwd when the root cannot be resolved, e.g. a bare directory).
|
||||
*/
|
||||
async function resolveGitPath(cwd: string, raw: string, selected?: string): Promise<string> {
|
||||
if (isAbsolute(raw)) return requireAbsolute(raw)
|
||||
if (isAbsolute(raw)) return requireAbsolute(resolveSessionPath(cwd, raw))
|
||||
// Prefer the session-relative interpretation when it names an existing
|
||||
// path. Git status reports repository-root-relative names, but the sidebar
|
||||
// security boundary is the session workspace; this preference keeps files
|
||||
|
||||
Reference in New Issue
Block a user