Improve handling for git repositories again