mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
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:
@@ -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 — обходим дерево */ }
|
||||
|
||||
Reference in New Issue
Block a user