aboutsummaryrefslogtreecommitdiff
path: root/Annex/Branch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2018-01-04 14:46:58 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2018-01-04 14:46:58 -0400
commitaff4d31f8f8132d06a76bb311093efed3af7bedb (patch)
treef587c2b0191f41b2f680333743cd51481630b8f9 /Annex/Branch.hs
parentabbefad307ed40e9ed01e2991fe89fb2f9eb8bb0 (diff)
more core.sharedRepository perm fixes
Fix more places where files in .git/annex/ were written with modes that did not take the core.sharedRepository config into account. This commit was sponsored by Jeff Goeke-Smith on Patreon.
Diffstat (limited to 'Annex/Branch.hs')
-rw-r--r--Annex/Branch.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 6cb279702..2c7683e9e 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -57,6 +57,7 @@ import Annex.CatFile
import Annex.Perms
import Logs
import Logs.Transitions
+import Logs.File
import Logs.Trust.Pure
import Logs.Difference.Pure
import Annex.ReplaceFile
@@ -420,8 +421,7 @@ needUpdateIndex branchref = do
setIndexSha :: Git.Ref -> Annex ()
setIndexSha ref = do
f <- fromRepo gitAnnexIndexStatus
- liftIO $ writeFile f $ fromRef ref ++ "\n"
- setAnnexFilePerm f
+ writeLogFile f $ fromRef ref ++ "\n"
runAnnexHook postUpdateAnnexHook
{- Stages the journal into the index and returns an action that will
@@ -583,7 +583,7 @@ ignoreRefs rs = do
old <- getIgnoredRefs
let s = S.unions [old, S.fromList rs]
f <- fromRepo gitAnnexIgnoredRefs
- replaceFile f $ \tmp -> liftIO $ writeFile tmp $
+ writeLogFile f $
unlines $ map fromRef $ S.elems s
getIgnoredRefs :: Annex (S.Set Git.Sha)
@@ -600,7 +600,7 @@ addMergedRefs new = do
-- Keep only the newest sha for each branch.
let l = nubBy ((==) `on` snd) (new ++ old)
f <- fromRepo gitAnnexMergedRefs
- replaceFile f $ \tmp -> liftIO $ writeFile tmp $
+ writeLogFile f $
unlines $ map (\(s, b) -> fromRef s ++ '\t' : fromRef b) l
getMergedRefs :: Annex (S.Set Git.Sha)