honor core.sharedRepository when making all the other files in the annex

Lock files, directories, etc.
This commit is contained in:
Joey Hess 2012-04-21 16:59:49 -04:00
parent 7e45712d19
commit b98b69e8c6
8 changed files with 119 additions and 33 deletions

View file

@ -75,6 +75,17 @@ isExecutable mode = combineModes ebits `intersectFileModes` mode /= 0
where
ebits = [ownerExecuteMode, groupExecuteMode, otherExecuteMode]
{- Runs an action without that pesky umask influencing it, unless the
- passed FileMode is the standard one. -}
noUmask :: FileMode -> IO a -> IO a
noUmask mode a
| mode == stdFileMode = a
| otherwise = bracket setup cleanup go
where
setup = setFileCreationMask nullFileMode
cleanup = setFileCreationMask
go _ = a
combineModes :: [FileMode] -> FileMode
combineModes [] = undefined
combineModes [m] = m