get rid of racy addLink
The remaining callers all did not rely on it checking gitignore, so were easy to convert. They were susceptable to the same overwrite race as add and fix, although less likely to have it and a narrower window than add's race. Command.Rekey in passing got an unncessary call to removeFile deleted. addSymlink handles deleting any existing worktree file.
This commit is contained in:
parent
7ace804d8e
commit
78a3d44ea0
7 changed files with 15 additions and 47 deletions
|
@ -123,8 +123,7 @@ cleanup file newkey = do
|
|||
ifM (isJust <$> isAnnexLink file)
|
||||
( do
|
||||
-- Update symlink to use the new key.
|
||||
liftIO $ removeFile (fromRawFilePath file)
|
||||
addLink (CheckGitIgnore False) file newkey Nothing
|
||||
addSymlink file newkey Nothing
|
||||
, do
|
||||
mode <- liftIO $ catchMaybeIO $ fileMode <$> R.getFileStatus file
|
||||
liftIO $ whenM (isJust <$> isPointerFile file) $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue