[Git] Replace CollectFiles recursivity.

This implementation is faster, should work lazily while it still collects files and easier to read.