Describe the bug
gh pr create appears to always crash on a local repo with more than one remote. Specifically, an error is raised when checking for an existing PR. This happens regardless if already pushed my branch to one of the remotes or not.
$ gh pr create
? Where should we push the 'dep/bump_matplotlib_3.6.0' branch? <origin>
error checking for existing pull request: no remote for "neutrinoceros:<branch_name>@{push}" found in "upstream, origin"
$ git push --set-upstream origin <branch_name>
$ gh pr create
error checking for existing pull request: no remote for "neutrinoceros:<branch_name>@{push}" found in "upstream, origin"
Affected version
This is a regression in 2.66.0 . 2.65.0 worked fine for me.
Steps to reproduce the behavior
$ git clone git@github.com:neutrinoceros/cli.git
$ cd cli
$ git remote add upstream https://github.com/cli/cli
$ git switch -c testbranch
$ echo "hello world" > testfile.txt
$ git add testfile.txt
$ git commit -am "test commit"
$ gh repo set-default
<cli/cli>
$ gh pr create
? Where should we push the 'testbranch' branch? neutrinoceros/cli
error checking for existing pull request: no remote for "neutrinoceros:testbranch@{push}" found in "upstream, origin"
Expected vs actual behavior
gh pr create should still work in a triangular workflow
Logs
$ GH_DEBUG=true gh pr create
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2025-01-31 10:53:57.39598 +0100 CET m=+0.125380751
* Request to https://api.github.com/graphql
* Request took 389.563792ms
[git symbolic-ref --quiet HEAD]
[git status --porcelain]
[git config --get-regexp ^branch\.testbranch\.(remote|merge|pushremote|gh-merge-base)$]
[git show-ref --verify -- HEAD refs/remotes/upstream/testbranch refs/remotes/origin/testbranch]
* Request at 2025-01-31 10:53:57.858646 +0100 CET m=+0.588045959
* Request to https://api.github.com/graphql
* Request took 348.268709ms
* Request at 2025-01-31 10:53:58.241026 +0100 CET m=+0.970424584
* Request to https://api.github.com/graphql
* Request took 203.035125ms
? Where should we push the 'testbranch' branch? neutrinoceros/cli
[git -c log.ShowSignature=false log --pretty=format:%H%x00%s%x00%b%x00 --cherry upstream/trunk...testbranch]
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
[git config --get-regexp ^branch\.neutrinoceros:testbranch\.(remote|merge|pushremote|gh-merge-base)$]
[git remote -v]
⣾[git config --get-regexp ^remote\..*\.gh-resolved$]
[git config push.default]
[git rev-parse --abbrev-ref neutrinoceros:testbranch@{push}]
[git config remote.pushDefault]
error checking for existing pull request: no remote for "neutrinoceros:testbranch@{push}" found in "upstream, origin"
Describe the bug
gh pr createappears to always crash on a local repo with more than one remote. Specifically, an error is raised when checking for an existing PR. This happens regardless if already pushed my branch to one of the remotes or not.Affected version
This is a regression in 2.66.0 . 2.65.0 worked fine for me.
Steps to reproduce the behavior
Expected vs actual behavior
gh pr create should still work in a triangular workflow
Logs