MDL-43355 testing: Return the hash when HEAD points to a hash