Warning · Logic
Impact
If URL construction also fails, callers receive that exception instead of the head SHA `ValueError` they received before this change.
Recommended action
Restore head SHA validation before URL construction when no cancellation event is supplied.