ci: check-inputs trackedFiles no longer prints git noise on synthetic trees

`execFileSync('git ls-files')` inherited stderr, so every call on a test's
temporary tree printed "fatal: not a git repository" although the failure is
caught and the tree is walked instead — dozens of lines in the owner's Windows
run and in CI logs. stderr is ignored; behaviour unchanged.

Issue: #496
User-Visible: no
This commit is contained in:
Claude
2026-09-09 02:29:08 +03:00
parent eb3abe2053
commit 687056f3f5
+4 -1
View File
@@ -85,7 +85,10 @@ const matchesAny = (file, globs) => globs.some((glob) => globToRegExp(glob).test
/** Отслеживаемые файлы (git), либо обход дерева там, где git недоступен. */
export function trackedFiles(root) {
try {
const out = execFileSync('git', ['-C', root, 'ls-files', '-z'], { encoding: 'utf8' });
// stderr глушится (#496): на синтетических деревьях тестов git отвечает
// «fatal: not a git repository», и без этого каждый вызов печатал его в лог,
// хотя отказ штатно ловится ниже и дерево обходится вручную.
const out = execFileSync('git', ['-C', root, 'ls-files', '-z'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
const files = out.split('\0').filter(Boolean);
if (files.length) return files.sort();
} catch { /* не git — обходим дерево */ }