libgit2/libgit2 — pull request #1551 by nvloff (2013-05-06 17:39:55+00:00)
Title: git_branch_set_upstream with local branches

Currently git_branch_set_upstream when passed a local branch
creates invalid configuration, for ex. if we setup branch
'tracking_master' to track local 'master' libgit2 generates
the following config

```
[branch "track_master"]
remote = .
merge = .refs/heads/track_master
```

The merge value is invalid and calling git_branch_upstream on
'tracking_master' results in invalid reference error.

It should do:

```
[branch "track_master"]
remote = .
merge = refs/heads/master
```