more OsPath conversion
Sponsored-by: Nicholas Golder-Manning
This commit is contained in:
parent
0376bc5ee0
commit
27305042f3
24 changed files with 180 additions and 153 deletions
|
@ -64,7 +64,7 @@ hookWrite h r = ifM (doesFileExist f)
|
|||
-- they typically use unix newlines, which does work there
|
||||
-- and makes the repository more portable.
|
||||
viaTmp F.writeFile' f (encodeBS (hookScript h))
|
||||
void $ tryIO $ modifyFileMode (fromOsPath f) (addModes executeModes)
|
||||
void $ tryIO $ modifyFileMode f (addModes executeModes)
|
||||
return True
|
||||
|
||||
{- Removes a hook. Returns False if the hook contained something else, and
|
||||
|
|
|
@ -61,7 +61,7 @@ cleanCorruptObjects fsckresults r = do
|
|||
removeLoose s = removeWhenExistsWith R.removeLink $
|
||||
fromOsPath $ looseObjectFile r s
|
||||
removeBad s = do
|
||||
void $ tryIO $ allowRead $ fromOsPath $ looseObjectFile r s
|
||||
void $ tryIO $ allowRead $ looseObjectFile r s
|
||||
whenM (isMissing s r) $
|
||||
removeLoose s
|
||||
|
||||
|
@ -85,7 +85,7 @@ explodePacks r = go =<< listPackFiles r
|
|||
putStrLn "Unpacking all pack files."
|
||||
forM_ packs $ \packfile -> do
|
||||
-- Just in case permissions are messed up.
|
||||
allowRead (fromOsPath packfile)
|
||||
allowRead packfile
|
||||
-- May fail, if pack file is corrupt.
|
||||
void $ tryIO $
|
||||
pipeWrite [Param "unpack-objects", Param "-r"] r' $ \h ->
|
||||
|
@ -477,7 +477,7 @@ preRepair g = do
|
|||
writeFile (fromOsPath headfile) "ref: refs/heads/master"
|
||||
explodePackedRefsFile g
|
||||
unless (repoIsLocalBare g) $
|
||||
void $ tryIO $ allowWrite $ fromOsPath $ indexFile g
|
||||
void $ tryIO $ allowWrite $ indexFile g
|
||||
where
|
||||
headfile = localGitDir g </> literalOsPath "HEAD"
|
||||
validhead s = "ref: refs/" `isPrefixOf` s
|
||||
|
@ -652,5 +652,5 @@ successfulRepair = fst
|
|||
|
||||
safeReadFile :: OsPath -> IO B.ByteString
|
||||
safeReadFile f = do
|
||||
allowRead (fromOsPath f)
|
||||
allowRead f
|
||||
F.readFile' f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue