diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-04 15:46:33 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-04 15:46:33 -0400 |
commit | a7cc06b30d3ae8a9801a68729db23dd66f8dadf6 (patch) | |
tree | b500f785b37815cf82d82da299881e07931ab27c /Command/Fsck.hs | |
parent | 307212395c912ab268109521ceae1bf192f728d8 (diff) |
Use lower case hash directories for storing files on crippled filesystems, same as is already done for bare repositories.
* since this is a crippled filesystem anyway, git-annex doesn't use
symlinks on it
* so there's no reason to use the mixed case hash directories that we're
stuck using to avoid breaking everyone's symlinks to the content
* so we can do what is already done for all bare repos, and make non-bare
repos on crippled filesystems use the all-lower case hash directories
* which are, happily, all 3 letters long, so they cannot conflict with
mixed case hash directories
* so I was able to 100% fix this and even resuming `git annex add` in the
test case will recover and it will all just work.
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 501483b14..0d70f697b 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -188,7 +188,7 @@ check cs = all id <$> sequence cs -} fixLink :: Key -> FilePath -> Annex Bool fixLink key file = do - want <- calcGitLink file key + want <- inRepo $ gitAnnexLink file key have <- getAnnexLinkTarget file maybe noop (go want) have return True @@ -223,7 +223,7 @@ verifyLocationLog key desc = do {- Since we're checking that a key's file is present, throw - in a permission fixup here too. -} when (present && not direct) $ do - file <- inRepo $ gitAnnexLocation key + file <- calcRepo $ gitAnnexLocation key freezeContent file freezeContentDir file @@ -281,7 +281,7 @@ checkKeySize :: Key -> Annex Bool checkKeySize key = ifM isDirect ( return True , do - file <- inRepo $ gitAnnexLocation key + file <- calcRepo $ gitAnnexLocation key ifM (liftIO $ doesFileExist file) ( checkKeySizeOr badContent key file , return True @@ -322,7 +322,7 @@ checkKeySizeOr bad key file = case Types.Key.keySize key of -} checkBackend :: Backend -> Key -> Annex Bool checkBackend backend key = do - file <- inRepo $ gitAnnexLocation key + file <- calcRepo $ gitAnnexLocation key ifM isDirect ( ifM (goodContent key file) ( checkBackendOr' (badContentDirect file) backend key file @@ -443,14 +443,14 @@ needFsck _ _ = return True -} recordFsckTime :: Key -> Annex () recordFsckTime key = do - parent <- parentDir <$> inRepo (gitAnnexLocation key) + parent <- parentDir <$> calcRepo (gitAnnexLocation key) liftIO $ void $ tryIO $ do touchFile parent setSticky parent getFsckTime :: Key -> Annex (Maybe EpochTime) getFsckTime key = do - parent <- parentDir <$> inRepo (gitAnnexLocation key) + parent <- parentDir <$> calcRepo (gitAnnexLocation key) liftIO $ catchDefaultIO Nothing $ do s <- getFileStatus parent return $ if isSticky $ fileMode s |