diff --git a/source/snag/core/rules.d b/source/snag/core/rules.d index ef585bd..d8a2c9c 100644 --- a/source/snag/core/rules.d +++ b/source/snag/core/rules.d @@ -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"