mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-05 23:34:19 -04:00
fix bug pull request files will be broken if head repo was transfered to another user or orgnization (#8571)
This commit is contained in:
parent
c1152b15fe
commit
d4501ece55
@ -1486,6 +1486,13 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) error
|
|||||||
return fmt.Errorf("update owner: %v", err)
|
return fmt.Errorf("update owner: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update pull request headusername
|
||||||
|
if _, err := sess.Where("head_repo_id = ?", repo.ID).Update(&PullRequest{
|
||||||
|
HeadUserName: newOwner.LowerName,
|
||||||
|
}); err != nil {
|
||||||
|
return fmt.Errorf("update pull request: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Remove redundant collaborators.
|
// Remove redundant collaborators.
|
||||||
collaborators, err := repo.getCollaborators(sess)
|
collaborators, err := repo.getCollaborators(sess)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user