Just use take to get max_files
Some cleanup for git_scanner
Don't call expand when unnecessary

It can be slow for large file lists