-
Notifications
You must be signed in to change notification settings - Fork 3k
Detect pull requests against upstream repositories #3907
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -862,19 +862,22 @@ export const make = Effect.gen(function* () { | |
| const shouldProbeLocalBranchSelector = | ||
| headBranchFromUpstream.length === 0 || headBranch === details.branch; | ||
|
|
||
| const [remoteRepository, originRepository] = yield* Effect.all( | ||
| const [remoteRepository, upstreamRepository, originRepository] = yield* Effect.all( | ||
| [ | ||
| resolveRemoteRepositoryContext(cwd, remoteName), | ||
| resolveRemoteRepositoryContext(cwd, "upstream"), | ||
| resolveRemoteRepositoryContext(cwd, "origin"), | ||
| ], | ||
| { concurrency: "unbounded" }, | ||
| ); | ||
|
|
||
| const targetRepository = | ||
| upstreamRepository.repositoryNameWithOwner !== null ? upstreamRepository : originRepository; | ||
| const isCrossRepository = | ||
| remoteRepository.repositoryNameWithOwner !== null && | ||
| originRepository.repositoryNameWithOwner !== null | ||
| targetRepository.repositoryNameWithOwner !== null | ||
| ? remoteRepository.repositoryNameWithOwner.toLowerCase() !== | ||
| originRepository.repositoryNameWithOwner.toLowerCase() | ||
| targetRepository.repositoryNameWithOwner.toLowerCase() | ||
|
Comment on lines
879
to
+880
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this comparison reclassifies a fork branch relative to Useful? React with 👍 / 👎.
Comment on lines
876
to
+880
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This new comparison makes conventional fork checkouts probe Useful? React with 👍 / 👎. |
||
| : remoteName !== null && | ||
| remoteName !== "origin" && | ||
| remoteRepository.repositoryNameWithOwner !== null; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
originis an organization-owned fork and a GitHubupstreamexists, selectingupstreamRepositoryhere makesisCrossRepositorytrue; laterpreferredHeadSelectorbecomesorg:branchandrunPrStepsends it togh pr create --headwith the new--repo upstreamcontext. I checked the GitHub CLI manual forgh pr create, which says--headsupports<user>:<branch>but using an organization as that owner is unsupported, so Create PR now fails for org-owned forks even though user-owned forks work.Useful? React with 👍 / 👎.