add stage number to stagedDetails parser

And convert parser to attoparsec, probably faster.

Before, a parse failure threw the whole --stage output line in to the
filename, which was certianly a bad idea, so fixed that.
This commit is contained in:
Joey Hess 2020-07-08 14:54:29 -04:00
parent c1eaf5b930
commit 7347e50123
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 42 additions and 27 deletions

View file

@ -349,9 +349,9 @@ applyView' mkviewedfile getfilemetadata view = do
liftIO . nukeFile =<< fromRepo gitAnnexViewIndex
viewg <- withViewIndex gitRepo
withUpdateIndex viewg $ \uh -> do
forM_ l $ \(f, sha, mode) -> do
forM_ l $ \(f, sha, mode, _) -> do
topf <- inRepo (toTopFilePath f)
go uh topf sha (toTreeItemType =<< mode) =<< lookupFile f
go uh topf sha (toTreeItemType mode) =<< lookupFile f
liftIO $ void clean
genViewBranch view
where
@ -365,7 +365,7 @@ applyView' mkviewedfile getfilemetadata view = do
f' <- fromRawFilePath <$>
fromRepo (fromTopFilePath $ asTopFilePath $ toRawFilePath fv)
stagesymlink uh f' =<< calcRepo (gitAnnexLink f' k)
go uh topf (Just sha) (Just treeitemtype) Nothing
go uh topf sha (Just treeitemtype) Nothing
| "." `B.isPrefixOf` getTopFilePath topf =
liftIO $ Git.UpdateIndex.streamUpdateIndex' uh $
pureStreamer $ updateIndexLine sha treeitemtype topf