fix some build warnings from ghc 9.4.6

For some reason it doesn't notice that req must be a Req, because
the toplevel function matched on that.
This commit is contained in:
Joey Hess 2023-09-21 13:38:36 -04:00
parent 3f6aff89b1
commit a147a31baa
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -106,9 +106,13 @@ parseReq opts
fixupReq :: Req -> Options -> Annex Req
fixupReq req@(UnmergedReq {}) _ = return req
fixupReq req@(Req {}) opts =
check rOldFile rOldMode (\r f -> r { rOldFile = f }) req
>>= check rNewFile rNewMode (\r f -> r { rNewFile = f })
check rOldFile rOldMode setoldfile req
>>= check rNewFile rNewMode setnewfile
where
setoldfile r@(Req {}) f = r { rOldFile = f }
setoldfile r@(UnmergedReq {}) _ = r
setnewfile r@(Req {}) f = r { rNewFile = f }
setnewfile r@(UnmergedReq {}) _ = r
check getfile getmode setfile r = case readTreeItemType (encodeBS (getmode r)) of
Just TreeSymlink -> do
v <- getAnnexLinkTarget' f False