libgit2/rugged — pull request #242 by nvloff (2013-07-30 09:05:24+00:00)
Title: Upstream branches

I wrote this 3 moths ago and fixed it up a bit.

Added:
* ``branch.remote`` - If the branch is remote returns the remote it belongs to.
In case of local branch, it returns the remote of the branch it tracks or nil
if there is no tracking branch. I think i got this from ``libgit2sharp``.
* ``branch.upstream`` and ``branch.upstream=`` - get and set remote tracking for a branch

There is also a hidden ``branch.remote_name`` there are situations where you have some branches with the remote they belong to is no longer present. Most of those situations are related to broken configs. Also it doesn't seem very useful to get a remote name without using the remote itself. So for now ``.remote_name`` is hidden from rdoc. Does this sound reasonable?

Fixes:
* ``branch.name`` is no longer the reference name after a gsub. It seems better to get it from libgit2. The side effect here is that ``Rugged::Reference`` now has `name` aliased to `cannonical_name`