Support "merge upstream branch" (Sync fork) (#32741)

Add basic "sync fork" support (GitHub-like)

<details>

![image](https://github.com/user-attachments/assets/e71473f4-4518-48c7-b9e2-fedfcd564fc3)

</details>
This commit is contained in:
wxiaoguang 2024-12-07 05:10:35 +08:00 committed by GitHub
parent 5a75160c92
commit 513da407f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 328 additions and 141 deletions

View file

@ -65,7 +65,9 @@ func Update(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.
return fmt.Errorf("unable to load HeadRepo for PR[%d] during update-by-merge: %w", pr.ID, err)
}
// use merge functions but switch repos and branches
// TODO: FakePR: it is somewhat hacky, but it is the only way to "merge" at the moment
// ideally in the future the "merge" functions should be refactored to decouple from the PullRequest
// now use a fake reverse PR to switch head&base repos/branches
reversePR := &issues_model.PullRequest{
ID: pr.ID,