@@ -161,7 +161,9 @@ fetchWith (supportsRev, kind, addArgs) source = do
161161 ExitFailure _ -> return Nothing
162162 ExitSuccess -> do
163163 buf <- BS.hGetContents stdoutH
164− let (l:ls) = reverse (BS.lines buf)
164+ let (l,ls) = case reverse (BS.lines buf) of
165+ [] -> error "This can't happen, but GHC doesn't know that."
166+ (x:xs) -> (x,xs)
165167 buf' = BS.unlines (reverse ls)
166168 case length ls of
167169 0 -> return Nothing