fix another potential race with the watcher and direct mode
Watcher wants to rewrite symlink to fix it. But in direct mode, the symlink could be replaced at any time with file content that has finished being transferred by some other process. So, just don't touch it. FWIW, I audited the rest of the assistant for places where it removes files, and the rest is ok. I have not audited the rest of git-annex.
This commit is contained in:
parent
1d388d5579
commit
c908672f3d
1 changed files with 3 additions and 2 deletions
|
@ -206,8 +206,9 @@ onAddSymlink isdirect file filestatus = go =<< liftAnnex (Backend.lookupFile fil
|
|||
checkcontent key s
|
||||
ensurestaged (Just link) s
|
||||
, do
|
||||
liftIO $ removeFile file
|
||||
liftAnnex $ Backend.makeAnnexLink link file
|
||||
unless isdirect $ do
|
||||
liftIO $ removeFile file
|
||||
liftAnnex $ Backend.makeAnnexLink link file
|
||||
checkcontent key =<< getDaemonStatus
|
||||
addlink link
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue