mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-17 04:19:29 +02:00
chore(refactor): split repo_service.ForkRepository in two
ForkRepository performs two different functions: * The fork itself, if it does not already exist * Updates and notifications after the fork is performed The function is split to reflect that and otherwise unmodified. The two function are given different names to: * clarify which integration tests provides coverage * distinguish it from the notification method by the same name
This commit is contained in:
parent
a83f5cd0f0
commit
cfefe2b6c9
9 changed files with 25 additions and 15 deletions
|
@ -23,7 +23,7 @@ func TestForkRepository(t *testing.T) {
|
|||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 13})
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 10})
|
||||
|
||||
fork, err := ForkRepository(git.DefaultContext, user, user, ForkRepoOptions{
|
||||
fork, err := ForkRepositoryAndUpdates(git.DefaultContext, user, user, ForkRepoOptions{
|
||||
BaseRepo: repo,
|
||||
Name: "test",
|
||||
Description: "test",
|
||||
|
@ -39,7 +39,7 @@ func TestForkRepository(t *testing.T) {
|
|||
setting.Repository.AllowForkWithoutMaximumLimit = false
|
||||
// user has reached maximum limit of repositories
|
||||
user.MaxRepoCreation = 0
|
||||
fork2, err := ForkRepository(git.DefaultContext, user, user, ForkRepoOptions{
|
||||
fork2, err := ForkRepositoryAndUpdates(git.DefaultContext, user, user, ForkRepoOptions{
|
||||
BaseRepo: repo,
|
||||
Name: "test",
|
||||
Description: "test",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue