bench.sh: only print git information when we're in git oopsla2013 oopsla2013-final
authorBrian Norris <banorris@uci.edu>
Sat, 1 Jun 2013 01:14:31 +0000 (18:14 -0700)
committerBrian Norris <banorris@uci.edu>
Sat, 1 Jun 2013 01:14:31 +0000 (18:14 -0700)
bench.sh

index 195e72d25e2541877078223073d17223d200ea92..cbe29bc5bce8f82fd9cf6c310bb0225c0a9e1ba3 100755 (executable)
--- 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
 }
 
        #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
 run_all_tests