Refactored getStagedFiles for git.