Fix git index exception

@devoncarew Fixes issues when .lock file was added in a git project.