better limiting of start actions to only run whenAnnexed
Mostly only refactoring, but this does remove one redundant stat of the symlink by copy.
This commit is contained in:
parent
4389782628
commit
b327227ba5
16 changed files with 67 additions and 63 deletions
|
@ -17,11 +17,11 @@ def = [command "fix" paramPaths seek
|
|||
"fix up symlinks to point to annexed content"]
|
||||
|
||||
seek :: [CommandSeek]
|
||||
seek = [withFilesInGit start]
|
||||
seek = [withFilesInGit $ whenAnnexed start]
|
||||
|
||||
{- Fixes the symlink to an annexed file. -}
|
||||
start :: FilePath -> CommandStart
|
||||
start file = isAnnexed file $ \(key, _) -> do
|
||||
start :: FilePath -> (Key, Backend Annex) -> CommandStart
|
||||
start file (key, _) = do
|
||||
link <- calcGitLink file key
|
||||
l <- liftIO $ readSymbolicLink file
|
||||
if link == l
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue