Fix 'head' vs 'HEAD' commit resolution