fix some build warnings from ghc 9.4.6
It now notices that a RepoLocation may not be Local, in which case pattern matching on Local wouldn't do. However, in these cases, I think it always is a Local. In particular, Git.Config.read is only run on local repos and upgrades LocalUnknown to Local.
This commit is contained in:
parent
784be819b3
commit
e03e907705
2 changed files with 5 additions and 3 deletions
|
@ -260,7 +260,7 @@ adjustGitDirFile :: RepoLocation -> IO RepoLocation
|
|||
adjustGitDirFile loc = fromMaybe loc <$> adjustGitDirFile' loc
|
||||
|
||||
adjustGitDirFile' :: RepoLocation -> IO (Maybe RepoLocation)
|
||||
adjustGitDirFile' loc = do
|
||||
adjustGitDirFile' loc@(Local {}) = do
|
||||
let gd = gitdir loc
|
||||
c <- firstLine <$> catchDefaultIO "" (readFile (fromRawFilePath gd))
|
||||
if gitdirprefix `isPrefixOf` c
|
||||
|
@ -275,7 +275,7 @@ adjustGitDirFile' loc = do
|
|||
else return Nothing
|
||||
where
|
||||
gitdirprefix = "gitdir: "
|
||||
|
||||
adjustGitDirFile' _ = error "internal"
|
||||
|
||||
newFrom :: RepoLocation -> Repo
|
||||
newFrom l = Repo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue