Добавлен фильтр по исключению пустых строк в ответе от git-вызова, так как ответ может быть пустым

This commit is contained in:
Alexander Zhirov 2025-05-28 02:26:55 +03:00
parent 016455d8f2
commit 9f8759238b
Signed by: alexander
GPG key ID: C8D8BE544A27C511

View file

@ -86,7 +86,7 @@ class SnagRules {
git(
["diff", "--cached", "--name-only"],
"Failed to retrieve the list of files removed from tracking"
).output.split('\n')[0..$-1].each!(
).output.split('\n').filter!(e => !e.strip.empty).each!(
file => git(
["add", "-f", file],
"Failed to restore the file to tracking"
@ -98,7 +98,7 @@ class SnagRules {
git(
["ls-files", "-i", "-c", "--exclude-standard"],
"Failed to get the list of files to remove from tracking"
).output.split('\n')[0..$-1].each!(
).output.split('\n').filter!(e => !e.strip.empty).each!(
file => git(
["rm", "--cached", file],
"Failed to remove file from tracking"