libgit2/libgit2 — pull request #1450 by carlosmn (2013-03-31 04:30:46+00:00)
Title: Branch upstream configuration

First rename `git_branch_tracking` to `git_branch_upstream` to use clearer nomenclature and then add `set_upstream` and `unset_upstream` to let the user manage the upstream configuration without needing to care how the configuration is written.

For `set_upstream` I kept going back and forth between passing a `{remote, refname}` pair and the upstream branch directly. Given the unfortunate complexity of getting the pair, I went with "whatever `git_branch_lookup` will do something with" which should give the least surprising result for a given string.

I'm still not quite sure whether the split-up version of `git_branch_remote_name` should return the remote name or the remote directly, as we then have to load it again in `set_upstream`.