This is a strange case. It appears that if `git_branch_is_head()` returns an error code, the current implementation of this function eats the error code and returns 0. That seems incorrect to me, but I'm not certain. Anyway, if it is incorrect, then this should probably be rewritten to:

```c
    if ((error = git_branch_is_head(ref)) < 0)
        goto on_error;
    should_head_by_updated = (error > 0);
```

I prefer the assignment to `should_head_be_updated` to be a boolean expression instead of simply a cast to `(bool)` just to insulate against anything odd happening inside `git_branch_is_head()`.