aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-09-14 18:07:08 +0100
committerGitHub <noreply@github.com>2021-09-14 18:07:08 +0100
commit0a542dd59f8061797976f33690bf10357aa0b0ad (patch)
treea74494a0e8120e4bfd32583e152ef466641de17b /routers/web/repo/setting.go
parent26ef180f466046f9cfab87eea5ea93f5d6da6998 (diff)
downloadgitea-0a542dd59f8061797976f33690bf10357aa0b0ad.tar.gz
gitea-0a542dd59f8061797976f33690bf10357aa0b0ad.zip
Decrement Fork Num when converting from Fork (#17035)
When converting repositories from forks to normal the root NumFork needs to be decremented too. Fix #17026 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/web/repo/setting.go')
-rw-r--r--routers/web/repo/setting.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go
index 72bacebd27..ad7a330381 100644
--- a/routers/web/repo/setting.go
+++ b/routers/web/repo/setting.go
@@ -555,10 +555,8 @@ func SettingsPost(ctx *context.Context) {
return
}
- repo.IsFork = false
- repo.ForkID = 0
- if err := models.UpdateRepository(repo, false); err != nil {
- log.Error("Unable to update repository %-v whilst converting from fork", repo)
+ if err := repository.ConvertForkToNormalRepository(repo); err != nil {
+ log.Error("Unable to convert repository %-v from fork. Error: %v", repo, err)
ctx.ServerError("Convert Fork", err)
return
}