completion: refactor __git_complete_index_file()