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

Merge same repo once and check fs object is valid (#578)

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks
2022-09-28 16:43:07 +08:00
committed by GitHub
parent 550e75cb0b
commit 04350f2b99
8 changed files with 127 additions and 46 deletions

View File

@@ -2461,11 +2461,8 @@ func updateDir(repoID, dirPath, newDirID, user, headID string) (string, error) {
err := fmt.Errorf("directory %s doesn't exist in repo %s", dirName, repo.StoreID)
return "", err
}
newDent := new(fsmgr.SeafDirent)
newDent.ID = newDirID
newDent.Mode = (syscall.S_IFDIR | 0644)
newDent.Mtime = time.Now().Unix()
newDent.Name = dirName
newDent := fsmgr.NewDirent(newDirID, dirName, (syscall.S_IFDIR | 0644), time.Now().Unix(), "", 0)
rootID, err := doPutFile(repo, headCommit.RootID, canonPath, newDent)
if err != nil || rootID == "" {