Should this be `return error;`? It seems like this will eat the error from `git_reference_set_target` if a race caused the target to be moved.