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 store r rsyncopts
| not $ Git.repoIsUrl (repo r) = | not $ Git.repoIsUrl (repo r) =
byteStorer $ \k b p -> guardUsable (repo r) False $ liftIO $ do byteStorer $ \k b p -> guardUsable (repo r) False $ liftIO $ do
let dest = gCryptLocation r k let f = gCryptLocation r k
createDirectoryIfMissing True $ parentDir dest let d = parentDir f
meteredWriteFile p dest b createDirectoryIfMissing True d
allowWrite d
void $ liftIO $ tryIO $ allowWrite f
meteredWriteFile p f b
preventWrite f
preventWrite d
return True return True
| Git.repoIsSsh (repo r) = if isShell r | Git.repoIsSsh (repo r) = if isShell r
then fileStorer $ \k f p -> Ssh.rsyncHelper (Just p) then fileStorer $ \k f p -> Ssh.rsyncHelper (Just p)