[CMAKE] Silent git error output when running from cmake
Summary:
The standard output is set to a variable and the result code is handled
by the cmake script, so there is no need for displaying the errors.
The output displayed on screen can be confusing in case of an error,
i.e:
fatal: not a git repository (or any of the parent directories): .git
when building from a github archive and not a repo
clone (see https://github.com/Bitcoin-ABC/bitcoin-abc/issues/371).
Test Plan:
Don't run the test plan on your local dev repo. Clone a new one and
remove the .git directory.
cmake -GNinja .. ninja check
There should be no fatal error output message.
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D5455