Fixes empty symbolic-ref for HEAD in pre-commit hook