Fix bug in git index

This fixes two bugs

1) Update the index correctly on a git commit
2) Git index was not handling the newly added folders correclty.

@devoncarew