summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-28 16:34:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-28 16:34:58 -0400
commit996e5eee01c83e6a95b51ac10ed5d2b39616d092 (patch)
treebe2ed7e52c1f48598f8851c40262d4555e2df3da /Command
parenta87822bbb29559919ef74bcc8cc29cca128831f5 (diff)
parent3b2cbf21040d36c032f657c25ad2e85b90e1b380 (diff)
Merge branch 'master' into s3
Conflicts: debian/changelog
Diffstat (limited to 'Command')
-rw-r--r--Command/Fsck.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 216c87493..bedb9fb99 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -7,6 +7,7 @@
module Command.Fsck where
+import Control.Monad (when)
import Control.Monad.State (liftIO)
import Command
@@ -18,6 +19,7 @@ import Messages
import Utility
import Content
import LocationLog
+import Locations
command :: [Command]
command = [repoCommand "fsck" (paramOptional $ paramRepeating paramPath) seek
@@ -47,9 +49,16 @@ perform key file backend numcopies = do
in this repository only. -}
verifyLocationLog :: Key -> FilePath -> Annex Bool
verifyLocationLog key file = do
+ g <- Annex.gitRepo
present <- inAnnex key
- g <- Annex.gitRepo
+ -- Since we're checking that a key's file is present, throw
+ -- in a permission fixup here too.
+ when present $ liftIO $ do
+ let f = gitAnnexLocation g key
+ preventWrite f
+ preventWrite (parentDir f)
+
u <- getUUID g
uuids <- liftIO $ keyLocations g key