in tools/pkgutils.py: recursively searching up for .git directory until
reaching / on Unix or drive root on Windows