diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-12-27 16:12:48 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-12-27 16:12:48 -0400 |
commit | 269c84914660586ab4e8baee0b51a69316d37d0d (patch) | |
tree | 34b1a33eabb49ecf35ba2c398d744a927507b3fc | |
parent | 45ce0f79aa0fdf0a9981bb5b803ffbd34aeac153 (diff) |
fix file perms after breaking hard link
-rw-r--r-- | Command/Fix.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Command/Fix.hs b/Command/Fix.hs index 4a8f25493..e63cebf42 100644 --- a/Command/Fix.hs +++ b/Command/Fix.hs @@ -16,6 +16,7 @@ import qualified Annex import Annex.Version import Annex.ReplaceFile import Annex.Content +import Annex.Perms import qualified Annex.Queue import qualified Database.Keys #ifdef WITH_CLIBS @@ -70,9 +71,11 @@ start fixwhat file key = do breakHardLink :: FilePath -> Key -> FilePath -> CommandPerform breakHardLink file key obj = do - replaceFile file $ \tmp -> + replaceFile file $ \tmp -> do unlessM (checkedCopyFile key obj tmp) $ error "unable to break hard link" + thawContent tmp + modifyContent obj $ freezeContent obj Database.Keys.storeInodeCaches key [file] next $ return True |