Skipped test in test_coding_standards
Rationale
The CI server gives a message like: "SKIPPED [1] ../../../../../opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/cartopy/tests/test_coding_standards.py:78: cartopy installation did not look like a git repo: /opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12 is not a git repository." suggesting it cannot find the root directory (locally seems to work fine).
Implications
This PR tries a different approach to finding the git repository location so the test [which checks the license headers] will not be skipped.
This might be problematic for downstream packagers if they put their stuff in git and Cartopy is unpacked in that directory. But downstream packagers probably don't want to check stylistic things like this, so tests like this should probably get a pytest marker so they can be skipped.
Over at https://github.com/SciTools/cf-units/pull/364#discussion_r1501764951, @pelson suggested these checks would be better via pre-commit hooks. I found this insert-license is a supported hook.
Edit: I opened https://github.com/SciTools/.github/issues/22 to see if Iris wants to do something like that. If they do, we could just follow.