Hi,
I come across this observation that if I have a local branch, even though I have pushed it to remote on github using git command line, the branch_get_upstream() still doesn't work.
To replicate this issue, I forked your repo and pushed a test branch with dummy commit. Below are my findings
you can see that calling branches() I can clearly see one local branch test and one remote branch test, but branch_get_upstream() returned NULL.
Note: you cannot replicate this issue if you cloned a repo and checked out a remote branch, you have to create a local and then push to remote in terminial.