more OsPath conversion
Git.Types now uses it, as does TopFilePath, making for plenty of new compile errors needing fixing. Sponsored-by: Brock Spratlen
This commit is contained in:
parent
12660314f1
commit
ea775baccd
22 changed files with 159 additions and 163 deletions
|
@ -99,7 +99,7 @@ read' repo = go repo
|
|||
global :: IO (Maybe Repo)
|
||||
global = do
|
||||
home <- myHomeDir
|
||||
ifM (doesFileExist $ home </> ".gitconfig")
|
||||
ifM (doesFileExist $ toOsPath home </> literalOsPath ".gitconfig")
|
||||
( Just <$> withCreateProcess p go
|
||||
, return Nothing
|
||||
)
|
||||
|
@ -153,22 +153,22 @@ store' k v repo = repo
|
|||
-}
|
||||
updateLocation :: Repo -> IO Repo
|
||||
updateLocation r@(Repo { location = LocalUnknown d }) = case isBare r of
|
||||
Just True -> ifM (doesDirectoryExist (fromRawFilePath dotgit))
|
||||
Just True -> ifM (doesDirectoryExist dotgit)
|
||||
( updateLocation' r $ Local dotgit Nothing
|
||||
, updateLocation' r $ Local d Nothing
|
||||
)
|
||||
Just False -> mknonbare
|
||||
{- core.bare not in config, probably because safe.directory
|
||||
- did not allow reading the config -}
|
||||
Nothing -> ifM (Git.Construct.isBareRepo (fromRawFilePath d))
|
||||
Nothing -> ifM (Git.Construct.isBareRepo d)
|
||||
( mkbare
|
||||
, mknonbare
|
||||
)
|
||||
where
|
||||
dotgit = d P.</> ".git"
|
||||
dotgit = d </> literalOsPath ".git"
|
||||
-- git treats eg ~/foo as a bare git repository located in
|
||||
-- ~/foo/.git if ~/foo/.git/config has core.bare=true
|
||||
mkbare = ifM (doesDirectoryExist (fromRawFilePath dotgit))
|
||||
mkbare = ifM (doesDirectoryExist dotgit)
|
||||
( updateLocation' r $ Local dotgit Nothing
|
||||
, updateLocation' r $ Local d Nothing
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue