aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/admin.go2
-rw-r--r--models/repo.go5
2 files changed, 2 insertions, 5 deletions
diff --git a/models/admin.go b/models/admin.go
index f75428ad4e..4480d11480 100644
--- a/models/admin.go
+++ b/models/admin.go
@@ -63,7 +63,7 @@ func RemoveAllWithNotice(title, path string) {
func removeAllWithNotice(e Engine, title, path string) {
if err := os.RemoveAll(path); err != nil {
desc := fmt.Sprintf("%s [%s]: %v", title, path, err)
- log.Warn(desc)
+ log.Warn(title+" [%s]: %v", path, err)
if err = createNotice(e, NoticeRepository, desc); err != nil {
log.Error("CreateRepositoryNotice: %v", err)
}
diff --git a/models/repo.go b/models/repo.go
index 8819debd4b..215222e279 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1882,10 +1882,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
}
oidPath := filepath.Join(v.Oid[0:2], v.Oid[2:4], v.Oid[4:len(v.Oid)])
- err = os.Remove(filepath.Join(setting.LFS.ContentPath, oidPath))
- if err != nil {
- return err
- }
+ removeAllWithNotice(sess, "Delete orphaned LFS file", oidPath)
}
if _, err := sess.Delete(&LFSMetaObject{RepositoryID: repoID}); err != nil {