1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Add emptySourceBlob and sourceBlob functions to Source

This commit is contained in:
joshvera 2016-08-09 15:50:40 -04:00
parent 46b1a7385e
commit 5aac311a88

View File

@ -30,6 +30,11 @@ modeToDigits (SymlinkBlob mode) = showOct mode ""
defaultPlainBlob :: SourceKind
defaultPlainBlob = PlainBlob 0o100644
emptySourceBlob :: FilePath -> SourceBlob
emptySourceBlob filepath = SourceBlob (Source.fromList "") Source.nullOid filepath Nothing
sourceBlob :: Source Char -> FilePath -> SourceBlob
sourceBlob source filepath = SourceBlob source Source.nullOid filepath (Just defaultPlainBlob)
-- | Map blobs with Nothing blobKind to empty blobs.
idOrEmptySourceBlob :: SourceBlob -> SourceBlob