summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-27 15:38:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-27 15:38:59 -0400
commit73d1f889c0b6d63fefcc3296bcd0402b1caed419 (patch)
tree83a383a64477bdc3c1e64b2fc60ae2db81f475b3 /Remote/Git.hs
parentab9fbc09ed26e5e18ce0097236c41bb34f04d16c (diff)
assistant: Support repairing git remotes that are locally accessible
(eg, on removable drives) gcrypt remotes are not yet handled. This commit was sponsored by Sören Brunk.
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 480d4f714..ba247078b 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -117,6 +117,9 @@ gen r u c gc
, remoteFsck = if Git.repoIsUrl r
then Nothing
else Just $ fsckOnRemote r
+ , repairRepo = if Git.repoIsUrl r
+ then Nothing
+ else Just $ repairRemote r
, config = M.empty
, localpath = localpathCalc r
, repo = r
@@ -419,6 +422,10 @@ fsckOnRemote r params
] ++ env
batchCommandEnv program (Param "fsck" : params) (Just env')
+{- The passed repair action is run in the Annex monad of the remote. -}
+repairRemote :: Git.Repo -> Annex Bool -> Annex (IO Bool)
+repairRemote r a = return $ Remote.Git.onLocal r a
+
{- Runs an action on a local repository inexpensively, by making an annex
- monad using that repository. -}
onLocal :: Git.Repo -> Annex a -> IO a