Guard against querying the git hash when git repository information is not present.
mock_autotools.cmake
runs git log -1 --format=%h
to determine the git hash variable set in config.h.in
. This is ultimately displayed when running Octopus (see print_header()
in utils.F90
).
For packaged releases, which strip out the git information, cmake returns the error:
fatal: not a git repository (or any parent up to mount point /)
This does not affect configuration, but it is confusing to the user. As such, I've added a guard such that this call is only made if .git
is present.
This closes issue #1197 (closed)