Fix write to index with msysgit bash

Closes #388.