Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr edit uses the branches merge, not pushRemote #4966

Closed
NLincoln opened this issue Dec 27, 2021 · 1 comment
Closed

pr edit uses the branches merge, not pushRemote #4966

NLincoln opened this issue Dec 27, 2021 · 1 comment
Labels
bug Something isn't working needs-triage needs to be reviewed

Comments

@NLincoln
Copy link

Describe the bug

Version:

gh version 2.4.0 (2021-12-21)
https://github.com/cli/cli/releases/tag/v2.4.0

Steps to reproduce the behavior

  • Open a PR
  • Add the following to the repositories .git/config:
[branch "xyz-feature-branch"]
	pushRemote = origin
	remote = origin
	merge = refs/heads/main

This should indicate to git that:

  • Pushes, by default, go to origin/xyz-feature-branch
  • The "upstream" of this branch is origin/main

However, upon typing gh pr edit --add-reviewers I get the error message:

no pull requests found for branch "develop"

If you change the .git/config to be:

[branch "xyz-feature-branch"]
	pushRemote = origin

Then gh works.

Expected vs actual behavior

Expected: The github cli uses the pushremote, not the merge remote to determine the PR to edit
Actual: The cli seems to use the merge remote :)

Logs

❯ gh pr edit --add-reviewer redacted
no pull requests found for branch "develop"
@NLincoln NLincoln added the bug Something isn't working label Dec 27, 2021
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Dec 27, 2021
@mislav
Copy link
Contributor

mislav commented Jan 6, 2022

Agreed, we should be paying attention to pushRemote! Duplicate of #575 (comment)

@mislav mislav closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants