summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-12 15:54:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-12 15:54:35 -0400
commitb2ffbaf43ca2773e51ff2d5665db67f86f8ccdd7 (patch)
tree5b98d88bf1cbaf9e0d41458f6b9469f1895d6bdf /Assistant
parent4515c27f4273969ef2fae1dc0f90dbe98a905eae (diff)
Support hot-swapping of removable drives containing gcrypt repositories.
To support this, a core.gcrypt-id is stored by git-annex inside the git config of a local gcrypt repository, when setting it up. That is compared with the remote's cached gcrypt-id. When different, a drive has been changed. git-annex then looks up the remote config for the uuid mapped from the core.gcrypt-id, and tweaks the configuration appropriately. When there is no known config for the uuid, it will refuse to use the remote.
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/MountWatcher.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Assistant/Threads/MountWatcher.hs b/Assistant/Threads/MountWatcher.hs
index 143ae9cee..970585b42 100644
--- a/Assistant/Threads/MountWatcher.hs
+++ b/Assistant/Threads/MountWatcher.hs
@@ -174,14 +174,14 @@ remotesUnder dir = do
pairs <- liftAnnex $ mapM (checkremote repotop) rs
let (waschanged, rs') = unzip pairs
when (any id waschanged) $ do
- liftAnnex $ Annex.changeState $ \s -> s { Annex.remotes = rs' }
+ liftAnnex $ Annex.changeState $ \s -> s { Annex.remotes = catMaybes rs' }
updateSyncRemotes
- return $ map snd $ filter fst pairs
+ return $ catMaybes $ map snd $ filter fst pairs
where
checkremote repotop r = case Remote.localpath r of
Just p | dirContains dir (absPathFrom repotop p) ->
(,) <$> pure True <*> updateRemote r
- _ -> return (False, r)
+ _ -> return (False, Just r)
type MountPoints = S.Set Mntent