Fix git initialization with GD

This fixes git repo initialization from GD.
It also is a minor GD fix to not crash on no-existent plugins.