remove write bit when storing to local gcrypt repo

Same as is done by rsync, and for regular git repos.
This commit is contained in:
Joey Hess 2014-08-03 20:24:13 -04:00
parent d12becfdde
commit d3778e631b

View file

@ -300,9 +300,14 @@ store :: Remote -> Remote.Rsync.RsyncOpts -> Storer
store r rsyncopts
| not $ Git.repoIsUrl (repo r) =
byteStorer $ \k b p -> guardUsable (repo r) False $ liftIO $ do
let dest = gCryptLocation r k
createDirectoryIfMissing True $ parentDir dest
meteredWriteFile p dest b
let f = gCryptLocation r k
let d = parentDir f
createDirectoryIfMissing True d
allowWrite d
void $ liftIO $ tryIO $ allowWrite f
meteredWriteFile p f b
preventWrite f
preventWrite d
return True
| Git.repoIsSsh (repo r) = if isShell r
then fileStorer $ \k f p -> Ssh.rsyncHelper (Just p)