some easy createDirectoryUnder conversions

This commit is contained in:
Joey Hess 2020-03-05 14:56:47 -04:00
parent ebbc5004fa
commit 6d58ca94d6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
12 changed files with 44 additions and 30 deletions

View file

@ -33,8 +33,9 @@ configureSmudgeFilter = unlessM (fromRepo Git.repoIsLocalBare) $ do
gf <- Annex.fromRepo Git.attributes
lfs <- readattr lf
gfs <- readattr gf
gittop <- fromRawFilePath . Git.localGitDir <$> gitRepo
liftIO $ unless ("filter=annex" `isInfixOf` (lfs ++ gfs)) $ do
createDirectoryIfMissing True (takeDirectory lf)
createDirectoryUnder gittop (takeDirectory lf)
writeFile lf (lfs ++ "\n" ++ unlines stdattr)
where
readattr = liftIO . catchDefaultIO "" . readFileStrict