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

Fix pr create when branch was already pushed to a non-base remote #1926

Merged
merged 4 commits into from
Sep 28, 2020

Conversation

mislav
Copy link
Contributor

@mislav mislav commented Sep 23, 2020

Bonus: also proposes a new command stubber for tests, one that matches commands by their invocation instead of sequentially and also asserts that all stubs have matched at the end of the test.

Fixes #1820, fixes #1762, fixes #1869, fixes #2001

Our previous command stub mechanism matches stubs sequentially, which leads to brittle tests when the exec calls get reordered or removed in the implementation.
Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new stub approach. Seems more flexible and robust than the previous version.

@mislav mislav added this to Needs to be merged 🎉 in The GitHub CLI Sep 24, 2020
@mislav mislav merged commit c11ff00 into trunk Sep 28, 2020
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Sep 28, 2020
@mislav mislav deleted the pr-create-branch-pushed-fix branch September 28, 2020 17:12
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Oct 6, 2020
@DanTup
Copy link

DanTup commented Nov 28, 2020

This PR says it fixes #2001, though I believe I'm still seeing that behaviour in the 1.3.0 release from a few days ago (as are others). If I run gh pr create --web it opens "github.com/Org/Repo/compare/master...master" when my changes are in DanTup:master, not the upstream.

@DanTup
Copy link

DanTup commented Nov 28, 2020

Oh, FWIW - seems like this only affects --web. If I drop that, it does create the PR correctly!

@mislav
Copy link
Contributor Author

mislav commented Dec 1, 2020

@DanTup Thanks for the report! We're fixing this already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
The GitHub CLI
  
Done 💤
3 participants