Fix bug in updating git index.
Skip git index update for untracked files.