Make detection of git repository work for submodules.