refactor test for reuse
support non-sha references, e.g. HEAD
simplify test a little
rename test