You can avoid the `goto` by inverting the logic here:

```c
if (!(error = git_revparse_single(left, repo, revspec)))
    error = git_revparse_single(right, repo, q);
git__free(revspec);
return error;
```