From 0c1a855fa8b4c773c3ab1e52dd5b83c1afb5aa00 Mon Sep 17 00:00:00 2001 From: Martin Jambon Date: Mon, 8 Feb 2021 13:13:44 -0800 Subject: [PATCH] Fix "ambiguous argument 'head'" error in test script and make future errors fatal. --- script/parse-examples | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/parse-examples b/script/parse-examples index c446a455..abd61e57 100755 --- a/script/parse-examples +++ b/script/parse-examples @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu cd "$(dirname "$0")/.." @@ -16,7 +16,8 @@ function clone_repo { fi pushd "$path" > /dev/null - if [ "$(git rev-parse head)" != "$sha" ]; then + actual_sha=$(git rev-parse HEAD) + if [ "$actual_sha" != "$sha" ]; then echo "Updating $owner/$name to $sha" git fetch git reset --hard $sha