libgit2/libgit2sharp — pull request #284 by jamill (2013-01-03 16:18:26+00:00)
Title: Set upstream information on a branch

Expose methods to set the Upstream information on a given branch. The API sets the specified branch as the upstream branch on the current branch object instance. If a local branch is passed in, it sets the upstream remote to the local remote ".".

I would appreciate any thoughts / alternatives on the reference string manipulations I am doing. I think these are correct and reasonable (maybe libgit2 can provide this utility in the future).

Also, the `TrackedBranch` property is a Lazy property - so, if this property has been read, and then we set the upstream information, it will not be reflected in the current branch object. The branch object has to be reloaded in order to get the current up to date information. I am not sure we want to invalidate the current branch object when we set a property that we know can make the object's state out of date.