From ef26df7f65900c9558c2882e5a105cdc6d438820 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 31 May 2013 18:14:31 -0700 Subject: [PATCH 1/1] bench.sh: only print git information when we're in git --- bench.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bench.sh b/bench.sh index 195e72d..cbe29bc 100755 --- a/bench.sh +++ b/bench.sh @@ -59,9 +59,16 @@ function run_all_tests { #run_test mpmc-queue/mpmc-queue ${MODEL_ARGS} -- -r 2 -w 2 } -cd .. -git log --oneline -1 -cd - > /dev/null -git log --oneline -1 -echo +# Check if git is available, and this is a git repository +GIT=0 +which git &> /dev/null && git rev-parse &> /dev/null && GIT=1 + +# Print out some git information, if available +if [ ${GIT} -ne 0 ]; then + cd .. + git log --oneline -1 + cd - > /dev/null + git log --oneline -1 + echo +fi run_all_tests -- 2.34.1