This speeds up the common case when IO is slow, e.g. when used with
We only use the short sha for figuring out whether the state is
valid (for which a long sha should also work) and for display when HEAD
is detached (I think that's the correct git-ism).
Working towards #3083.