clean warnings
This commit is contained in:
parent
ff3f654cbe
commit
44bb9a808f
2 changed files with 8 additions and 9 deletions
|
@ -228,7 +228,7 @@ getAllRefs :: Repo -> IO [Ref]
|
||||||
getAllRefs r = do
|
getAllRefs r = do
|
||||||
packedrs <- mapMaybe parsePacked . lines
|
packedrs <- mapMaybe parsePacked . lines
|
||||||
<$> catchDefaultIO "" (readFile $ packedRefsFile r)
|
<$> catchDefaultIO "" (readFile $ packedRefsFile r)
|
||||||
loosers <- map toref <$> dirContentsRecursive (localGitDir r </> "refs")
|
loosers <- map toref <$> dirContentsRecursive refdir
|
||||||
return $ packedrs ++ loosers
|
return $ packedrs ++ loosers
|
||||||
where
|
where
|
||||||
refdir = localGitDir r </> "refs"
|
refdir = localGitDir r </> "refs"
|
||||||
|
@ -335,9 +335,9 @@ verifyCommit missing goodcommits commit r
|
||||||
<*> extractSha treesha
|
<*> extractSha treesha
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
check [] = return True
|
check [] = return True
|
||||||
check ((commit, tree):rest)
|
check ((c, t):rest)
|
||||||
| checkGoodCommit commit goodcommits = return True
|
| checkGoodCommit c goodcommits = return True
|
||||||
| otherwise = verifyTree missing tree r <&&> check rest
|
| otherwise = verifyTree missing t r <&&> check rest
|
||||||
|
|
||||||
{- Verifies that a tree is good, including all trees and blobs
|
{- Verifies that a tree is good, including all trees and blobs
|
||||||
- referenced by it. -}
|
- referenced by it. -}
|
||||||
|
@ -361,13 +361,13 @@ rewriteIndex missing r
|
||||||
| repoIsLocalBare r = return []
|
| repoIsLocalBare r = return []
|
||||||
| otherwise = do
|
| otherwise = do
|
||||||
(indexcontents, cleanup) <- LsFiles.stagedDetails [Git.repoPath r] r
|
(indexcontents, cleanup) <- LsFiles.stagedDetails [Git.repoPath r] r
|
||||||
let (missing, present) = partition ismissing indexcontents
|
let (bad, good) = partition ismissing indexcontents
|
||||||
unless (null missing) $ do
|
unless (null bad) $ do
|
||||||
nukeFile (localGitDir r </> "index")
|
nukeFile (localGitDir r </> "index")
|
||||||
UpdateIndex.streamUpdateIndex r
|
UpdateIndex.streamUpdateIndex r
|
||||||
=<< (catMaybes <$> mapM reinject present)
|
=<< (catMaybes <$> mapM reinject good)
|
||||||
void cleanup
|
void cleanup
|
||||||
return $ map fst3 missing
|
return $ map fst3 bad
|
||||||
where
|
where
|
||||||
getblob (_file, Just sha, Just _mode) = Just sha
|
getblob (_file, Just sha, Just _mode) = Just sha
|
||||||
getblob _ = Nothing
|
getblob _ = Nothing
|
||||||
|
|
|
@ -11,7 +11,6 @@ import Common
|
||||||
import Git
|
import Git
|
||||||
import Git.Command
|
import Git.Command
|
||||||
import Git.Sha
|
import Git.Sha
|
||||||
import Git.CatFile
|
|
||||||
|
|
||||||
{- Gets the reflog for a given branch. -}
|
{- Gets the reflog for a given branch. -}
|
||||||
get :: Branch -> Repo -> IO [Sha]
|
get :: Branch -> Repo -> IO [Sha]
|
||||||
|
|
Loading…
Reference in a new issue