chiark / gitweb /
test suite: badcommit-rewrite: Check HEAD manipulation is right
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Jan 2017 18:15:01 +0000 (18:15 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Jan 2017 18:32:14 +0000 (18:32 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/badcommit-rewrite

index bcec8e6..c07d9ae 100755 (executable)
@@ -26,8 +26,16 @@ cd $tmp/git/$p.git
 ${DGIT_BADCOMMIT_FIXUP} --real
 
 cd $tmp/$p
+git symbolic-ref HEAD >../sym.before
+git rev-parse HEAD >../ref.before
+
 ${DGIT_BADCOMMIT_FIXUP} --real
 
+git symbolic-ref HEAD >../sym.after
+git rev-parse HEAD >../ref.after
+diff ../sym.before ../sym.after
+set +e; diff ../ref.before ../ref.after; rc=$?; set -e; test $rc = 1
+
 t-dgit fetch stable
 
 t-expect-fail "child $rstable lacks parent $badcommit" \