summaryrefslogtreecommitdiff
path: root/Creds.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Creds.hs')
-rw-r--r--Creds.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/Creds.hs b/Creds.hs
index 4c6896663..943276e3c 100644
--- a/Creds.hs
+++ b/Creds.hs
@@ -122,13 +122,7 @@ writeCacheCreds :: Creds -> FilePath -> Annex ()
writeCacheCreds creds file = do
d <- fromRepo gitAnnexCredsDir
createAnnexDirectory d
- liftIO $ do
- let f = d </> file
- h <- openFile f WriteMode
- modifyFileMode f $ removeModes
- [groupReadMode, otherReadMode]
- hPutStr h creds
- hClose h
+ liftIO $ writeFileProtected (d </> file) creds
readCacheCredPair :: CredPairStorage -> Annex (Maybe CredPair)
readCacheCredPair storage = maybe Nothing decodeCredPair