Closed ericswpark closed 1 month ago
branch_upstream_remote needs it in the form refs/heads/master
. Use head_ref.name()
instead of shorthand()
.
Great, thank you! That worked. Can this be added to the documentation or is it out of scope? I can submit a PR if it isn't. Feel free to close the issue otherwise :)
Yea, it could be added to the docs. There is some risk it will get out of sync with libgit2 if that behavior is ever changed, but it seems like a low risk.
I have a local git repository with the branch name
master
that tracksorigin/master
. I'm trying to write some Rust code to replicategit push && git push --tags
.Here is my code so far:
When I run the program, however, it panics at the
let upstream_remote
line, with the following output:The error message doesn't make sense, because the previous line of
let branch_name
got the currently active local branch. Am I callingbranch_upstream_remote
incorrectly?