1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Update topics repo count when deleting repository (#10081)

This commit is contained in:
Lauris BH
2020-01-31 10:04:49 +02:00
committed by GitHub
parent b3549bb5ec
commit 912ce27421
2 changed files with 27 additions and 3 deletions

View File

@@ -1910,6 +1910,12 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
return err
}
if len(repo.Topics) > 0 {
if err = removeTopicsFromRepo(sess, repo.ID); err != nil {
return err
}
}
// FIXME: Remove repository files should be executed after transaction succeed.
repoPath := repo.repoPath(sess)
removeAllWithNotice(sess, "Delete repository files", repoPath)