Handle excluded files and directories within get_untracked_files().

This change allows us to avoid traversing into excluded directories.