1.0dev: avoid internal errors when a Git repository has an invalid path.
1.0dev: avoid internal errors when a Git repository has an invalid path.

Patch by Peter Suter on #10819.

pkdevbox/trac,pkdevbox/trac,pkdevbox/trac,pkdevbox/trac