Fixes issue when git/index does not exist

  * This happens with submodules