summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 4a7eb859c4..f5ec1a9fdd 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -2456,6 +2456,17 @@ func ForkRepository(doer, u *User, oldRepo *Repository, name, desc string) (_ *R
return nil, err
}
+ oldMode, _ := AccessLevel(doer.ID, oldRepo)
+ mode, _ := AccessLevel(doer.ID, repo)
+
+ if err = PrepareWebhooks(oldRepo, HookEventFork, &api.ForkPayload{
+ Forkee: repo.APIFormat(mode),
+ Repo: oldRepo.APIFormat(oldMode),
+ Sender: doer.APIFormat(),
+ }); err != nil {
+ log.Error(2, "PrepareWebhooks [repo_id: %d]: %v", oldRepo.ID, err)
+ }
+
if err = repo.UpdateSize(); err != nil {
log.Error(4, "Failed to update size for repository: %v", err)
}