From 1499b9b79ddce2e46bc3cd91adeb4a0cd3ac5d2f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 27 Dec 2015 16:12:48 -0400 Subject: [PATCH] fix file perms after breaking hard link --- Command/Fix.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Command/Fix.hs b/Command/Fix.hs index 4a8f25493c..e63cebf420 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