convert from readFileStrict
This removes that function, using file-io readFile' instead. Had to deal with newline conversion, which readFileStrict does on Windows. In a few cases, that was pretty ugly to deal with. Sponsored-by: Kevin Mueller
This commit is contained in:
parent
de1af273e0
commit
6e27b0d4d1
19 changed files with 94 additions and 71 deletions
|
@ -20,6 +20,7 @@ import Annex.Content
|
|||
import Utility.Tmp
|
||||
import Logs
|
||||
import Messages.Progress
|
||||
import qualified Utility.FileIO as F
|
||||
|
||||
olddir :: Git.Repo -> FilePath
|
||||
olddir g
|
||||
|
@ -138,10 +139,11 @@ gitAttributesUnWrite repo = do
|
|||
let attributes = Git.attributes repo
|
||||
let attributes' = fromRawFilePath attributes
|
||||
whenM (doesFileExist attributes') $ do
|
||||
c <- readFileStrict attributes'
|
||||
c <- map decodeBS . fileLines'
|
||||
<$> F.readFile' (toOsPath attributes)
|
||||
liftIO $ viaTmp (writeFile . fromRawFilePath . fromOsPath)
|
||||
(toOsPath attributes)
|
||||
(unlines $ filter (`notElem` attrLines) $ lines c)
|
||||
(unlines $ filter (`notElem` attrLines) c)
|
||||
Git.Command.run [Param "add", File attributes'] repo
|
||||
|
||||
stateDir :: FilePath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue