Файли
openidea/scripts/gitignore.test.ts
T
l0ng-ai f160d60a7a test: keep .gitignore rules from matching tracked files (#8222)
A tracked file matched by an ignore rule is dropped when the sources are added to a new repository (source archive, fresh git add), as #8211 hit with crates/ide-ssh/src/target (fixed by #8215). scripts/gitignore.test.ts fails when any tracked file is ignored; it also removed fixtures/folding/.openidea/changelists.json, IDE state excluded by the fixture's own .openidea/.gitignore.
2026-12-05 20:22:05 +08:00

20 рядки
739 B
TypeScript

// @vitest-environment node
import { execFileSync } from "node:child_process";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
const repo = resolve(dirname(fileURLToPath(import.meta.url)), "..");
describe("the .gitignore rules", () => {
// A tracked file that an ignore rule matches goes missing when the sources are added to a
// new repository (a source archive, a fresh `git add`).
it("match no tracked file", () => {
const tracked = execFileSync("git", ["ls-files", "--cached", "--ignored", "--exclude-standard"], {
cwd: repo,
encoding: "utf8",
});
expect(tracked.split("\n").filter(Boolean)).toEqual([]);
});
});