You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pull_request_create pushes a branch to its own push target, not the pinned repository #483
Found in review of #482 (upstream sync to cd128e7774), left out of that PR on purpose.
Upstream's pull_request_create now pushes the branch before opening the pull request (pushAndOpenPullRequest in apps/server/src/git/GitManager.ts). Since #480 and #482 the pull request itself is pinned to origin's repository before any push. The push is not pinned: pushCurrentBranch (apps/server/src/vcs/GitVcsDriverCore.ts) follows the branch's own push target.
Problem
In a fork checkout, a local branch that tracks upstream/<same name> is pushed to upstream while the pull request is created against origin.
Without write access to upstream (the normal case) the push fails and the create fails with it. Nothing reaches upstream.
With write access, a branch would be published on the upstream repository.
Suggested fix
When the create is pinned to a repository, push to the remote that matches the pin, or refuse with a typed error when the branch's push target is a different repository. Add a case to the createPullRequest tests in GitManager.test.ts: branch tracks upstream/<name>, create with no repository named, assert no ref is created on the upstream remote.
Activity