diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-13 00:57:52 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-13 00:57:52 -0400 |
commit | df337bb63b4ed6e5d2ce563ec89d28d192e791db (patch) | |
tree | 638813a415727b8a5441ba450e20e6dc2632c970 /Assistant/Sync.hs | |
parent | a3913f52e52777b18bd8e50ff593a4f4085e8b93 (diff) |
hlint
Diffstat (limited to 'Assistant/Sync.hs')
-rw-r--r-- | Assistant/Sync.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs index 4a9cae767..c75767760 100644 --- a/Assistant/Sync.hs +++ b/Assistant/Sync.hs @@ -60,7 +60,7 @@ reconnectRemotes threadname st dstatus scanremotes rs = void $ - - Avoids running possibly long-duration commands in the Annex monad, so - as not to block other threads. -} -pushToRemotes :: ThreadName -> UTCTime -> ThreadState -> (Maybe FailedPushMap) -> [Remote] -> IO Bool +pushToRemotes :: ThreadName -> UTCTime -> ThreadState -> Maybe FailedPushMap -> [Remote] -> IO Bool pushToRemotes threadname now st mpushmap remotes = do (g, branch) <- runThreadState st $ (,) <$> fromRepo id <*> inRepo Git.Branch.current @@ -81,12 +81,12 @@ pushToRemotes threadname now st mpushmap remotes = do changeFailedPushMap pushmap $ \m -> M.union (makemap failed) $ M.difference m (makemap succeeded) - unless (ok) $ + unless ok $ debug threadname [ "failed to push to" , show failed ] - if (ok || not shouldretry) + if ok || not shouldretry then return ok else retry branch g failed @@ -100,12 +100,12 @@ pushToRemotes threadname now st mpushmap remotes = do go False (Just branch) g rs {- Manually pull from remotes and merge their branches. -} -manualPull :: ThreadState -> (Maybe Git.Ref) -> [Remote] -> IO Bool +manualPull :: ThreadState -> Maybe Git.Ref -> [Remote] -> IO Bool manualPull st currentbranch remotes = do g <- runThreadState st $ fromRepo id forM_ remotes $ \r -> Git.Command.runBool "fetch" [Param $ Remote.name r] g - haddiverged <- runThreadState st $ Annex.Branch.forceUpdate + haddiverged <- runThreadState st Annex.Branch.forceUpdate forM_ remotes $ \r -> runThreadState st $ Command.Sync.mergeRemote r currentbranch return haddiverged @@ -114,4 +114,4 @@ manualPull st currentbranch remotes = do syncNewRemote :: ThreadState -> DaemonStatusHandle -> ScanRemoteMap -> Remote -> IO () syncNewRemote st dstatus scanremotes remote = do runThreadState st $ updateKnownRemotes dstatus - void $ forkIO $ do reconnectRemotes "SyncRemote" st dstatus scanremotes [remote] + void $ forkIO $ reconnectRemotes "SyncRemote" st dstatus scanremotes [remote] |