Fix detecting PR for current branch pushed to fork by mislav · Pull Request #567 · cli/cli
@mislav this doesn't work for my test forked repo, the currentPRHeadRef doesn't have the OWNER bit.
Actually in my testing the other day, I've found that git.ReadBranchConfig() would return empty RemoteURL and RemoteName, because running git config --get-regexp '^branch.test-branch.*$' would return nothing (pattern '^branch.*.*$' wouldn't include that branch). It would only work after doing:
git remote add upstream git://github.com/username/base-repo.git git branch -u upstream/test-branch
Since I'm not an expert in working with forked repos, I just assumed this was expected. Because RemoteURL and RemoteName were both empty, prSelectorForCurrentBranch wouldn't define branchOwner and that // prepend OWNER: would never run.
Hope this helps!