diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-02 22:59:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-02 22:59:07 -0400 |
commit | c81a8bd68c53348b9e561dc588499452a5a654c7 (patch) | |
tree | d1c52c78723784f20c33763c282860878d19f979 /Assistant/Threads/Committer.hs | |
parent | 0d14a987dc4887de5516497206356652e846c996 (diff) |
hlint
Diffstat (limited to 'Assistant/Threads/Committer.hs')
-rw-r--r-- | Assistant/Threads/Committer.hs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 445f4753b..695703e22 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -112,7 +112,7 @@ waitChangeTime a = waitchanges 0 - that make up a file rename? Or some of the pairs that make up - a directory rename? -} - possiblyrename cs = all renamepart cs + possiblyrename = all renamepart renamepart (PendingAddChange _ _) = True renamepart c = isRmChange c @@ -309,7 +309,7 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do inRepo (Git.LsFiles.notInRepo False $ map changeFile pending) -- note: timestamp info is lost here let ts = changeTime exemplar - return (map (PendingAddChange ts) newfiles, void $ liftIO $ cleanup) + return (map (PendingAddChange ts) newfiles, void $ liftIO cleanup) returnWhen c a | c = return otherchanges @@ -317,12 +317,13 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do add :: Change -> Assistant (Maybe Change) add change@(InProcessAddChange { keySource = ks }) = - catchDefaultIO Nothing <~> do - sanitycheck ks $ do - (mkey, mcache) <- liftAnnex $ do - showStart "add" $ keyFilename ks - Command.Add.ingest $ Just ks - maybe (failedingest change) (done change mcache $ keyFilename ks) mkey + catchDefaultIO Nothing <~> doadd + where + doadd = sanitycheck ks $ do + (mkey, mcache) <- liftAnnex $ do + showStart "add" $ keyFilename ks + Command.Add.ingest $ Just ks + maybe (failedingest change) (done change mcache $ keyFilename ks) mkey add _ = return Nothing {- In direct mode, avoid overhead of re-injesting a renamed @@ -371,7 +372,7 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do ( inRepo $ gitAnnexLink file key , Command.Add.link file key mcache ) - whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ do + whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ stageSymlink file =<< hashSymlink link showEndOk return $ Just $ finishedChange change key @@ -415,8 +416,8 @@ safeToAdd _ [] [] = return [] safeToAdd delayadd pending inprocess = do maybe noop (liftIO . threadDelaySeconds) delayadd liftAnnex $ do - keysources <- mapM Command.Add.lockDown (map changeFile pending) - let inprocess' = inprocess ++ catMaybes (map mkinprocess $ zip pending keysources) + keysources <- forM pending $ Command.Add.lockDown . changeFile + let inprocess' = inprocess ++ mapMaybe mkinprocess (zip pending keysources) openfiles <- S.fromList . map fst3 . filter openwrite <$> findopenfiles (map keySource inprocess') let checked = map (check openfiles) inprocess' @@ -434,7 +435,7 @@ safeToAdd delayadd pending inprocess = do | S.member (contentLocation ks) openfiles = Left change check _ change = Right change - mkinprocess (c, Just ks) = Just $ InProcessAddChange + mkinprocess (c, Just ks) = Just InProcessAddChange { changeTime = changeTime c , keySource = ks } |