It's more that it generates the url based on the latest commit on that branch... maybe what we should do is generate the link based on the latest commit for that particular file, so even if you haven't pushed this particular branch, the link still points to the right place.
maybe what we should do is generate the link based on the latest commit for that particular file
Does this mean we should go back through the log and find the first commit present on the repo/remote? If so what we're thinking is using git branch -r --contains TheSHA (via libgit2sharp) to find the latest commit on the remote and use that SHA if it exists.
That example in the link is using local heads, but we could tweak it to find remotes with that commit.
The "Open on GitHub" feature always seems to try to open the file on master - if I'm on a branch that file might not exist or be completely different. It would be good to open the file on the correct branch on the site.