Check for detached head explicitly
rm redundant case
Check for undefined to avoid error on .match
No need for undefined check - check that inside fns used
Simplify code, reuse vars
Slightly clean up ref/hash reading
Report on detached head when commit to det head
Report on det head when try to commit when WC clean
Make update_ref support updating detached HEAD
Test committing to detached HEAD
Fix weird syntax