1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-19 18:16:25 +00:00

Fix root_id is empty in commit (#586)

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks
2022-12-06 14:38:45 +08:00
committed by GitHub
parent 798f77efb5
commit f02d2e5304

View File

@@ -1928,6 +1928,10 @@ func postMultiFilesRecursive(repo *repomgr.Repo, dirID, toPath, user string, den
return "", err return "", err
} }
ret = newdir.DirID ret = newdir.DirID
} else {
// The ret will be an empty string when failed to find parent dir, an error should be returned in such case.
err := fmt.Errorf("failed to find parent dir for %s", toPath)
return "", err
} }
return ret, nil return ret, nil
@@ -2576,6 +2580,9 @@ func putFileRecursive(repo *repomgr.Repo, dirID, toPath string, newDent *fsmgr.S
return "", err return "", err
} }
ret = newdir.DirID ret = newdir.DirID
} else {
err := fmt.Errorf("failed to find parent dir for %s", toPath)
return "", err
} }
return ret, nil return ret, nil