fix(windows): git path resolution for modified files across Git Bash, MSYS2, and Cygwin (#16422)

This commit is contained in:
Luke Parker
2026-03-07 15:42:14 +10:00
committed by GitHub
parent c42c5a0cc6
commit 8a95be492d
13 changed files with 286 additions and 102 deletions

View File

@@ -111,8 +111,10 @@ export const TuiThreadCommand = cmd({
}
// Resolve relative paths against PWD to preserve behavior when using --cwd flag
const root = process.env.PWD ?? process.cwd()
const cwd = args.project ? path.resolve(root, args.project) : process.cwd()
const root = Filesystem.resolve(process.env.PWD ?? process.cwd())
const cwd = args.project
? Filesystem.resolve(path.isAbsolute(args.project) ? args.project : path.join(root, args.project))
: root
const file = await target()
try {
process.chdir(cwd)