summaryrefslogtreecommitdiff
path: root/RemoteDaemon/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'RemoteDaemon/Common.hs')
-rw-r--r--RemoteDaemon/Common.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/RemoteDaemon/Common.hs b/RemoteDaemon/Common.hs
index 711771f97..366f6aaca 100644
--- a/RemoteDaemon/Common.hs
+++ b/RemoteDaemon/Common.hs
@@ -8,7 +8,7 @@
module RemoteDaemon.Common
( liftAnnex
, inLocalRepo
- , checkNewShas
+ , checkShouldFetch
, ConnectionStatus(..)
, robustConnection
) where
@@ -35,6 +35,13 @@ liftAnnex (TransportHandle _ annexstate) a = do
inLocalRepo :: TransportHandle -> (Git.Repo -> IO a) -> IO a
inLocalRepo (TransportHandle (LocalRepo g) _) a = a g
+-- Check if some shas should be fetched from the remote,
+-- and presumably later merged.
+checkShouldFetch :: RemoteGitConfig -> TransportHandle -> [Git.Sha] -> IO Bool
+checkShouldFetch gc transporthandle shas
+ | remoteAnnexPull gc = checkNewShas transporthandle shas
+ | otherwise = return False
+
-- Check if any of the shas are actally new in the local git repo,
-- to avoid unnecessary fetching.
checkNewShas :: TransportHandle -> [Git.Sha] -> IO Bool