Is there an explicit exit code from `git_reference_symbolic_target()` in that case?  (`GIT_ENOTFOUND`?)

I think we should test for that error and `giterr_clear()` if we find it and abort on other errors.