Allow fetching HEAD

`query_remote_ref` will return `None` for the ref `HEAD` but current implementation doesn't cover that case.

This allows using the deprecated `fetch_remote_sha` with HEAD as was possible previously

Fixes #3