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:
@@ -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 == "" {
|
||||
|
Reference in New Issue
Block a user