From 0f749f5f4c3e50d08ade6aeb0e7897f83d0f7bd7 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Tue, 6 May 2014 14:47:16 -0400 Subject: [PATCH] regress: setup_git_repo can assert that the repo is setup as intended --- regression/scaffold | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/regression/scaffold b/regression/scaffold index 546d8c6..8d57298 100644 --- a/regression/scaffold +++ b/regression/scaffold @@ -82,7 +82,13 @@ function setup_git_repo echo "abc" > def git add def git commit -s -m "initial" 2> /dev/null > /dev/null - # the commit should be d4850419ccc1146c7169f500725ce504b9774ed0 + + # The HEAD should be a specific hash. Abort the test if it is not. + # If we kept on executing, the test would just fail in mysterious + # ways. + rev=`git rev-parse HEAD` + [ "d4850419ccc1146c7169f500725ce504b9774ed0" != "$rev" ] && \ + die "setup_git_repo HEAD check failed (HEAD: $rev)" # Explicitly set config that the tests rely on. git config log.date default -- 2.11.4.GIT