Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.

Commit 77f570a

Browse files
author
iscai-msft
committed
try new copilot diff
1 parent 69720a2 commit 77f570a

1 file changed

Lines changed: 17 additions & 22 deletions

File tree

eng/scripts/check-for-changed-files.js

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22

33
const { run } = require("./helpers.js");
44

5-
// Stage all current changes first (if any)
6-
7-
run("git", ["add", "."], {
8-
encoding: "utf-8",
9-
stdio: [null, "pipe", "pipe"],
10-
});
11-
12-
// Reset the index but keep working directory
13-
run("git", ["reset"], {
5+
// First, reset any staged changes and clean the working directory
6+
run("git", ["reset", "HEAD", "."], {
147
encoding: "utf-8",
158
stdio: [null, "pipe", "pipe"],
169
});
@@ -21,27 +14,29 @@ run("git", ["add", "--renormalize", "."], {
2114
stdio: [null, "pipe", "pipe"],
2215
});
2316

24-
const proc = run("git", ["status", "--porcelain", "."], {
17+
// Check for differences ignoring whitespace and line endings
18+
const proc = run("git", ["diff", "--ignore-space-at-eol", "--ignore-blank-lines", "--cached"], {
2519
encoding: "utf-8",
2620
stdio: [null, "pipe", "pipe"],
2721
});
2822

29-
if (proc.stdout) {
30-
console.log(proc.stdout);
31-
}
32-
33-
if (proc.stderr) {
34-
console.error(proc.stderr);
35-
}
36-
37-
if (proc.stdout || proc.stderr) {
38-
const diffProc = run("git", ["diff", "."], {
23+
if (proc.stdout && proc.stdout.toString().trim()) {
24+
console.log("Detected actual content changes (ignoring line endings):");
25+
console.log(proc.stdout.toString());
26+
27+
// Also show the status for context
28+
const statusProc = run("git", ["status", "--porcelain", "."], {
3929
encoding: "utf-8",
4030
stdio: [null, "pipe", "pipe"],
4131
});
4232

43-
if (diffProc.stdout) {
44-
console.error(diffProc.stdout);
33+
if (statusProc.stdout) {
34+
console.log("Git status:");
35+
console.log(statusProc.stdout);
4536
}
37+
38+
console.error(
39+
`ERROR: There are actual content diffs in regeneration (excluding line ending changes). Please run 'inv regenerate' and re-run. You may also have to remove 'node_modules' and re-run 'npm install' to get the latest testserver.`,
40+
);
4641
process.exit(1);
4742
}

0 commit comments

Comments
 (0)