1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Fix #532, add system notice

This commit is contained in:
Unknwon
2014-10-08 18:29:18 -04:00
parent 54c9844d66
commit 1aa76bd279
12 changed files with 202 additions and 11 deletions

View File

@@ -934,9 +934,14 @@ func DeleteRepository(uid, repoId int64, userName string) error {
sess.Rollback()
return err
}
// Remove repository files.
if err = os.RemoveAll(RepoPath(userName, repo.Name)); err != nil {
sess.Rollback()
return err
desc := fmt.Sprintf("Fail to delete repository files(%s/%s): %v", userName, repo.Name, err)
log.Warn(desc)
if err = CreateRepositoryNotice(desc); err != nil {
log.Error(4, "Fail to add notice: %v", err)
}
}
return sess.Commit()
}