mcts-mem 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lint.js +9 -2
package/package.json
CHANGED
package/src/lint.js
CHANGED
|
@@ -177,9 +177,16 @@ export function lint(root, opts = {}) {
|
|
|
177
177
|
for (const b of [...n.facts, ...n.moves]) treeEntries.add(b.replace(/\s+/g, ' '));
|
|
178
178
|
}
|
|
179
179
|
for (const p of ctx.nodeFiles) {
|
|
180
|
-
|
|
180
|
+
// Resolve each node against the tree root (which is git's cwd) and let
|
|
181
|
+
// git map it to the worktree root via the `HEAD:./<path>` form. Deriving
|
|
182
|
+
// the path from `rev-parse --show-toplevel` is fragile on Windows, where
|
|
183
|
+
// the toplevel git reports and the realpath'd root can differ (short vs
|
|
184
|
+
// long names, drive-letter case): path.relative then yields a bogus
|
|
185
|
+
// ../.. chain, every lookup misses, and R-append silently never runs.
|
|
186
|
+
// Forward-slash because git pathspecs always use '/'.
|
|
187
|
+
const rel = path.relative(ctx.root, p).split(path.sep).join('/');
|
|
181
188
|
let old;
|
|
182
|
-
try { old = git('show', `HEAD
|
|
189
|
+
try { old = git('show', `HEAD:./${rel}`); } catch { continue; } // new file
|
|
183
190
|
const on = parseNode(old);
|
|
184
191
|
const oldEntries = [...on.facts, ...on.moves].map((b) => b.replace(/\s+/g, ' '));
|
|
185
192
|
const gone = oldEntries.filter((e) => !treeEntries.has(e));
|