diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-03-09 13:33:13 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-03-09 13:33:13 -0400 |
commit | 0e37e9778f38bfec13fb8bbd2f5e1e3323179fe4 (patch) | |
tree | c795773d7f5e54a2838312362b721107f7049d55 /Annex | |
parent | 11d0943415cc2267776c701b79e5b4e8a13b1792 (diff) |
Always try to thaw content, even when annex.crippledfilesystem is set.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content.hs | 9 | ||||
-rw-r--r-- | Annex/Perms.hs | 11 |
2 files changed, 16 insertions, 4 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 103fa264d..d14e87adc 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -951,8 +951,13 @@ chmodContent file = unlessM crippledFileSystem $ {- Allows writing to an annexed file that freezeContent was called on - before. -} thawContent :: FilePath -> Annex () -thawContent file = unlessM crippledFileSystem $ - withShared go +thawContent file = ifM crippledFileSystem + -- Probably cannot change mode on crippled filesystem, + -- but if file modes are supported, the content may be frozen + -- so try to thaw it. + ( void $ tryNonAsync $ withShared go + , withShared go + ) where go GroupShared = liftIO $ groupWriteRead file go AllShared = liftIO $ groupWriteRead file diff --git a/Annex/Perms.hs b/Annex/Perms.hs index 159cc328a..3905b7af9 100644 --- a/Annex/Perms.hs +++ b/Annex/Perms.hs @@ -92,8 +92,15 @@ freezeContentDir file = unlessM crippledFileSystem $ go _ = liftIO $ preventWrite dir thawContentDir :: FilePath -> Annex () -thawContentDir file = unlessM crippledFileSystem $ - liftIO $ allowWrite $ parentDir file +thawContentDir file = ifM crippledFileSystem + -- Probably cannot change mode on crippled filesystem, + -- but if file modes are supported, the directory may be frozen, + -- so try to thaw it. + ( void $ tryNonAsync go + , go + ) + where + go = liftIO $ allowWrite $ parentDir file {- Makes the directory tree to store an annexed file's content, - with appropriate permissions on each level. -} |