From b06bf6962d90008948fa0ce0d7aa56b3adc77e2c Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Wed, 29 Mar 2017 16:52:30 -0700 Subject: [PATCH] Update name sourceBlobs -> sourceBlobsFromArgs --- src/ParseCommand.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ParseCommand.hs b/src/ParseCommand.hs index 2212dfd9b..21c59125d 100644 --- a/src/ParseCommand.hs +++ b/src/ParseCommand.hs @@ -95,12 +95,6 @@ sourceBlobsFromPaths filePaths = identifierFor :: StringConv leaf T.Text => Syntax leaf (Term (Syntax leaf) (Record '[(Maybe SourceText), Range, Category, SourceSpan])) -> Maybe T.Text identifierFor = fmap toS . extractLeafValue . unwrap <=< maybeIdentifier --- | For the file paths and commit sha provided, extract only the BlobEntries and represent them as SourceBlobs. -sourceBlobs :: Arguments -> IO [SourceBlob] -sourceBlobs Arguments{..} = - case commitSha of - Just commitSha' -> sourceBlobsFromSha commitSha' - _ -> sourceBlobsFromPaths filePaths where sourceBlobsFromSha :: [Char] -> IO [SourceBlob] @@ -131,6 +125,12 @@ sourceBlobs Arguments{..} = toSourceKind (Git.ExecutableBlob mode) = Source.ExecutableBlob mode toSourceKind (Git.SymlinkBlob mode) = Source.SymlinkBlob mode +-- | For the file paths and commit sha provided, extract only the BlobEntries and represent them as SourceBlobs. +sourceBlobsFromArgs :: Arguments -> IO [SourceBlob] +sourceBlobsFromArgs Arguments{..} = + case commitSha of + Just commitSha' -> sourceBlobsFromSha commitSha' gitDir filePaths + _ -> sourceBlobsFromPaths filePaths -- | Return a parser that decorates with the source text. parseWithDecorator :: TermDecorator (Syntax Text) '[Range, Category, SourceSpan] field -> FilePath -> Parser (Syntax Text) (Record '[field, Range, Category, SourceSpan]) parseWithDecorator decorator path blob = decorateTerm decorator <$> parserForType (toS (takeExtension path)) blob