From: Brian Norris Date: Sat, 1 Jun 2013 01:14:31 +0000 (-0700) Subject: bench.sh: only print git information when we're in git X-Git-Tag: oopsla2013-final X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=commitdiff_plain;h=ef26df7f65900c9558c2882e5a105cdc6d438820 bench.sh: only print git information when we're in git --- 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