fix & refactor (#18973)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
f3cbdee38e
commit
eddd2fb242
|
@ -956,28 +956,28 @@ func DeleteRepository(doer *user_model.User, uid, repoID int64) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove archives
|
// Remove archives
|
||||||
for i := range archivePaths {
|
for _, archive := range archivePaths {
|
||||||
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.RepoArchives, "Delete repo archive file", archivePaths[i])
|
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.RepoArchives, "Delete repo archive file", archive)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove lfs objects
|
// Remove lfs objects
|
||||||
for i := range lfsPaths {
|
for _, lfsObj := range lfsPaths {
|
||||||
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.LFS, "Delete orphaned LFS file", lfsPaths[i])
|
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.LFS, "Delete orphaned LFS file", lfsObj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove issue attachment files.
|
// Remove issue attachment files.
|
||||||
for i := range attachmentPaths {
|
for _, attachment := range attachmentPaths {
|
||||||
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.Attachments, "Delete issue attachment", attachmentPaths[i])
|
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.Attachments, "Delete issue attachment", attachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove release attachment files.
|
// Remove release attachment files.
|
||||||
for i := range releaseAttachments {
|
for _, releaseAttachment := range releaseAttachments {
|
||||||
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.Attachments, "Delete release attachment", releaseAttachments[i])
|
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.Attachments, "Delete release attachment", releaseAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove attachment with no issue_id and release_id.
|
// Remove attachment with no issue_id and release_id.
|
||||||
for i := range newAttachmentPaths {
|
for _, newAttachment := range newAttachmentPaths {
|
||||||
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.Attachments, "Delete issue attachment", attachmentPaths[i])
|
admin_model.RemoveStorageWithNotice(db.DefaultContext, storage.Attachments, "Delete issue attachment", newAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(repo.Avatar) > 0 {
|
if len(repo.Avatar) > 0 {
|
||||||
|
|
Loading…
Reference in a new issue