From 02fe8a497434ed6b7cfa12d68779bcaa0d9813c2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 Jan 2016 15:56:24 -0400 Subject: improve data type --- Git/LsTree.hs | 4 ++-- Git/Repair.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Git') diff --git a/Git/LsTree.hs b/Git/LsTree.hs index 13f3e4bcd..b1d9190d0 100644 --- a/Git/LsTree.hs +++ b/Git/LsTree.hs @@ -26,7 +26,7 @@ import System.Posix.Types data TreeItem = TreeItem { mode :: FileMode , typeobj :: String - , sha :: String + , sha :: Ref , file :: TopFilePath } deriving Show @@ -66,7 +66,7 @@ parseLsTree :: String -> TreeItem parseLsTree l = TreeItem { mode = fst $ Prelude.head $ readOct m , typeobj = t - , sha = s + , sha = Ref s , file = asTopFilePath $ Git.Filename.decode f } where diff --git a/Git/Repair.hs b/Git/Repair.hs index b441f1337..fcfc03600 100644 --- a/Git/Repair.hs +++ b/Git/Repair.hs @@ -342,8 +342,8 @@ verifyTree missing treesha r | S.member treesha missing = return False | otherwise = do (ls, cleanup) <- pipeNullSplit (LsTree.lsTreeParams treesha []) r - let objshas = map (extractSha . LsTree.sha . LsTree.parseLsTree) ls - if any isNothing objshas || any (`S.member` missing) (catMaybes objshas) + let objshas = map (LsTree.sha . LsTree.parseLsTree) ls + if any (`S.member` missing) objshas then do void cleanup return False -- cgit v1.2.3