improve data type
This commit is contained in:
parent
f7256842cc
commit
ec28151722
5 changed files with 8 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue