Skip to content

Commit 0f749f5

Browse files
author
Josef 'Jeff' Sipek
committed
regress: setup_git_repo can assert that the repo is setup as intended
1 parent 12519cf commit 0f749f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

regression/scaffold

+7-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ function setup_git_repo
8282
echo "abc" > def
8383
git add def
8484
git commit -s -m "initial" 2> /dev/null > /dev/null
85-
# the commit should be d4850419ccc1146c7169f500725ce504b9774ed0
85+
86+
# The HEAD should be a specific hash. Abort the test if it is not.
87+
# If we kept on executing, the test would just fail in mysterious
88+
# ways.
89+
rev=`git rev-parse HEAD`
90+
[ "d4850419ccc1146c7169f500725ce504b9774ed0" != "$rev" ] && \
91+
die "setup_git_repo HEAD check failed (HEAD: $rev)"
8692

8793
# Explicitly set config that the tests rely on.
8894
git config log.date default

0 commit comments

Comments
 (0)