Fix possible missing .git/info path for sparse checkout feature

In order to avoid a missing path depending on the cloning method and git templates