Also here - I think we can set `pentry = NULL` at the beginning of this method and move the `git__free` into `on_error`.

I realize this is super pedantic, but I feel strongly that it's easier to refactor this later if we follow a common pattern - because I see this and it jumps out at me as different and I have to figure out what's special about it.