summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-14 09:23:33 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-14 09:23:33 -0400
commite8dd480f10f4f2b13e482514a0bfac016133016b (patch)
tree0ae1b7f7dab6dd0c196552b3b29bb3c5bcaaf03c
parent9100786beb0db4b3444d1be24e5a3bd680cdae1e (diff)
downloadgitea-e8dd480f10f4f2b13e482514a0bfac016133016b.tar.gz
gitea-e8dd480f10f4f2b13e482514a0bfac016133016b.zip
Litte bug fix
-rw-r--r--models/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 295b9af35f..4382bd7dc5 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -684,6 +684,10 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) {
sess.Rollback()
return err
}
+ if _, err = sess.Delete(&Milestone{RepoId: repoId}); err != nil {
+ sess.Rollback()
+ return err
+ }
rawSql := "UPDATE `user` SET num_repos = num_repos - 1 WHERE id = ?"
if _, err = sess.Exec(rawSql, userId); err != nil {