robbyrussell/oh-my-zsh — pull request #1003 by prathe (2012-03-08 18:19:20+00:00)
Title: Use git internal's @{upstream} reference to notice unmerged commits to a remote

We could try to guess the tracked remote branch by hardcoding the remote to `origin` and using the current branch name as the remote branch. This can work most of the time, but it is not robust. What if you set your master branch to push to another remote? This happens when I play with two or more forks on Github, I set the `origin` to the original repo I cloned from first and then fork thereafter.

I think using git internal reference to @{upstream} should be bullet proof for any kind of possible configuration you may have. And it is quite clean. Unknown but clean.

What do you think?