diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-10-08 18:29:18 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-10-08 18:29:18 -0400 |
commit | 1aa76bd27913e40780aa66fe6b6c1158e20b7bef (patch) | |
tree | afd0979216a6a4a6f3fe72d4f8c391fc5b7ab0fe /models/repo.go | |
parent | 54c9844d665cdd554ae8945aae2ee966df5ddfc4 (diff) | |
download | gitea-1aa76bd27913e40780aa66fe6b6c1158e20b7bef.tar.gz gitea-1aa76bd27913e40780aa66fe6b6c1158e20b7bef.zip |
Fix #532, add system notice
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 8e29b3357d..3a26c88f03 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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() } |