|
@@ -418,7 +418,7 @@ export namespace File {
|
|
|
const project = Instance.project
|
|
const project = Instance.project
|
|
|
if (project.vcs !== "git") return []
|
|
if (project.vcs !== "git") return []
|
|
|
|
|
|
|
|
- const diffOutput = await $`git -c core.quotepath=false diff --numstat HEAD`
|
|
|
|
|
|
|
+ const diffOutput = await $`git -c core.fsmonitor=false -c core.quotepath=false diff --numstat HEAD`
|
|
|
.cwd(Instance.directory)
|
|
.cwd(Instance.directory)
|
|
|
.quiet()
|
|
.quiet()
|
|
|
.nothrow()
|
|
.nothrow()
|
|
@@ -439,11 +439,12 @@ export namespace File {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const untrackedOutput = await $`git -c core.quotepath=false ls-files --others --exclude-standard`
|
|
|
|
|
- .cwd(Instance.directory)
|
|
|
|
|
- .quiet()
|
|
|
|
|
- .nothrow()
|
|
|
|
|
- .text()
|
|
|
|
|
|
|
+ const untrackedOutput =
|
|
|
|
|
+ await $`git -c core.fsmonitor=false -c core.quotepath=false ls-files --others --exclude-standard`
|
|
|
|
|
+ .cwd(Instance.directory)
|
|
|
|
|
+ .quiet()
|
|
|
|
|
+ .nothrow()
|
|
|
|
|
+ .text()
|
|
|
|
|
|
|
|
if (untrackedOutput.trim()) {
|
|
if (untrackedOutput.trim()) {
|
|
|
const untrackedFiles = untrackedOutput.trim().split("\n")
|
|
const untrackedFiles = untrackedOutput.trim().split("\n")
|
|
@@ -464,11 +465,12 @@ export namespace File {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Get deleted files
|
|
// Get deleted files
|
|
|
- const deletedOutput = await $`git -c core.quotepath=false diff --name-only --diff-filter=D HEAD`
|
|
|
|
|
- .cwd(Instance.directory)
|
|
|
|
|
- .quiet()
|
|
|
|
|
- .nothrow()
|
|
|
|
|
- .text()
|
|
|
|
|
|
|
+ const deletedOutput =
|
|
|
|
|
+ await $`git -c core.fsmonitor=false -c core.quotepath=false diff --name-only --diff-filter=D HEAD`
|
|
|
|
|
+ .cwd(Instance.directory)
|
|
|
|
|
+ .quiet()
|
|
|
|
|
+ .nothrow()
|
|
|
|
|
+ .text()
|
|
|
|
|
|
|
|
if (deletedOutput.trim()) {
|
|
if (deletedOutput.trim()) {
|
|
|
const deletedFiles = deletedOutput.trim().split("\n")
|
|
const deletedFiles = deletedOutput.trim().split("\n")
|
|
@@ -539,8 +541,14 @@ export namespace File {
|
|
|
const content = (await Filesystem.readText(full).catch(() => "")).trim()
|
|
const content = (await Filesystem.readText(full).catch(() => "")).trim()
|
|
|
|
|
|
|
|
if (project.vcs === "git") {
|
|
if (project.vcs === "git") {
|
|
|
- let diff = await $`git diff ${file}`.cwd(Instance.directory).quiet().nothrow().text()
|
|
|
|
|
- if (!diff.trim()) diff = await $`git diff --staged ${file}`.cwd(Instance.directory).quiet().nothrow().text()
|
|
|
|
|
|
|
+ let diff = await $`git -c core.fsmonitor=false diff ${file}`.cwd(Instance.directory).quiet().nothrow().text()
|
|
|
|
|
+ if (!diff.trim()) {
|
|
|
|
|
+ diff = await $`git -c core.fsmonitor=false diff --staged ${file}`
|
|
|
|
|
+ .cwd(Instance.directory)
|
|
|
|
|
+ .quiet()
|
|
|
|
|
+ .nothrow()
|
|
|
|
|
+ .text()
|
|
|
|
|
+ }
|
|
|
if (diff.trim()) {
|
|
if (diff.trim()) {
|
|
|
const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
|
|
const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
|
|
|
const patch = structuredPatch(file, file, original, content, "old", "new", {
|
|
const patch = structuredPatch(file, file, original, content, "old", "new", {
|