From 1cc1a3857f03c1bb1cda07aadf94020eb494a039 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 4 Oct 2021 21:05:04 +0200 Subject: [PATCH] Display git info in pm3_tests.sh only if doable This should fix the need for https://gitlab.com/kalilinux/packages/proxmark3/-/commit/da550dbec709d1a288ef310776a402c8fdd68e2e#6ab816ab956024f7eb2767197fe7fa5a5d0c5b32 --- tools/pm3_tests.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/pm3_tests.sh b/tools/pm3_tests.sh index c142714b4..765e868bd 100755 --- a/tools/pm3_tests.sh +++ b/tools/pm3_tests.sh @@ -216,11 +216,13 @@ if [ "$TRAVIS_COMMIT" ]; then fi fi -echo -n "git branch: " -git describe --all -echo -n "git sha: " -git rev-parse HEAD -echo "" +if command -v git >/dev/null && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + echo -n "git branch: " + git describe --all + echo -n "git sha: " + git rev-parse HEAD + echo "" +fi while true; do if $TESTALL || $TESTCOMMON; then