Explorar el Código

fix bug pull request files will be broken if head repo was transfered to another user or orgnization (#8571)

tags/v1.9.5
Lunny Xiao hace 4 años
padre
commit
d4501ece55
No account linked to committer's email address
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7
    0
      models/repo.go

+ 7
- 0
models/repo.go Ver fichero

@@ -1486,6 +1486,13 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) error
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.
collaborators, err := repo.getCollaborators(sess)
if err != nil {

Cargando…
Cancelar
Guardar