fix: use realpath consistently for init/dispose and drop unnecessary fsmonitor flag on git show

pull/16249/head
LukeParkerDev 2026-03-06 14:48:30 +10:00
parent 59af5bd0ef
commit 73a9c26fe9
2 changed files with 2 additions and 6 deletions

View File

@ -550,11 +550,7 @@ export namespace File {
.text() .text()
} }
if (diff.trim()) { if (diff.trim()) {
const original = await $`git -c core.fsmonitor=false show HEAD:${file}` const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
.cwd(Instance.directory)
.quiet()
.nothrow()
.text()
const patch = structuredPatch(file, file, original, content, "old", "new", { const patch = structuredPatch(file, file, original, content, "old", "new", {
context: Infinity, context: Infinity,
ignoreWhitespace: true, ignoreWhitespace: true,

View File

@ -53,8 +53,8 @@ export async function tmpdir<T>(options?: TmpDirOptions<T>) {
}), }),
) )
} }
const extra = await options?.init?.(dirpath)
const realpath = sanitizePath(await fs.realpath(dirpath)) const realpath = sanitizePath(await fs.realpath(dirpath))
const extra = await options?.init?.(realpath)
const result = { const result = {
[Symbol.asyncDispose]: async () => { [Symbol.asyncDispose]: async () => {
try { try {