mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
Backport #39619 by @wxiaoguang * Fix #39618 * Follow up #38588 * Remove unrelated errors Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
30cc41ff97
commit
15a0ea83ca
2 files changed
+7
-3
No files matched your search
@@ -119,7 +119,7 @@ func (l *LocalStorage) Stat(path string) (os.FileInfo, error) {
|
||||
|
||||
func (l *LocalStorage) deleteEmptyParentDirs(localFullPath string) {
|
||||
for parent := filepath.Dir(localFullPath); len(parent) > len(l.dir); parent = filepath.Dir(parent) {
|
||||
if err := util.RemoveWithRetry(parent); err != nil && !os.IsNotExist(err) {
|
||||
if err := os.Remove(parent); err != nil && !os.IsNotExist(err) {
|
||||
// since the target file has been deleted, parent dir error is not related to the file deletion itself.
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user