Optimize git add performance.

Don't calculate sha values on git add, but delay them until the file is committed. This will not affect `git status` as the `headSha` of the added file is `null` which will always differ from the `currentSha`. Morever, it will automatically get updated on next index update. Also we always update the index before a commit.

This fixes significant performance issue specially on chromeOs.

@devoncarew PTAL thanks.