fix: propagate fatal git errors from hasCommits

Merged
40
2mo ago
+52-2

Fixes #306

hasCommits() now treats only an unborn symbolic HEAD with no stored branch ref as the legitimate zero-commit case. Fatal Git failures (including detached or corrupt HEAD/refs) are rethrown with Git stderr preserved.

Adds a regression test that corrupts the current branch ref and verifies the Git failure is surfaced instead of being reported as an empty repository.

Validation attempted locally, but the execution environment cannot resolve github.com. CI should run the full format and test matrix.