If any of the command between "cd short-hand" and "cd .." failed,
after correcting the broken &&-chain, the next test will end up
running in short-hand directory, which it is not expecting. A
canonical way to avoid this problem is to replace the above with:

It is not immediately obvious to me why you have two copies of the
same test in your patch to see where HEAD points at. If the reason
is because you suspect that "git -C $there" form may give subtly
different behaviour and wanted to test both, then you could do
something like this: