diff --git a/src/Data/Blob.hs b/src/Data/Blob.hs index 7a8e9e4ef..be7f21fc9 100644 --- a/src/Data/Blob.hs +++ b/src/Data/Blob.hs @@ -3,7 +3,6 @@ module Data.Blob , BlobKind(..) , These(..) , modeToDigits -, defaultPlainBlob , nullBlob , sourceBlob , nullOid @@ -59,7 +58,6 @@ data Blob = Blob { blobSource :: Source -- ^ The UTF-8 encoded source text of the blob. , blobOid :: ByteString -- ^ The Git object ID (SHA-1) of the blob. , blobPath :: FilePath -- ^ The file path to the blob. - , blobKind :: BlobKind -- ^ The kind of blob. , blobLanguage :: Maybe Language -- ^ The language of this blob. Nothing denotes a langauge we don't support yet. } deriving (Show, Eq) @@ -73,15 +71,11 @@ modeToDigits (PlainBlob mode) = pack $ showOct mode "" modeToDigits (ExecutableBlob mode) = pack $ showOct mode "" modeToDigits (SymlinkBlob mode) = pack $ showOct mode "" --- | The default plain blob mode -defaultPlainBlob :: BlobKind -defaultPlainBlob = PlainBlob 0o100644 - nullBlob :: Blob -> Bool nullBlob Blob{..} = blobOid == nullOid || nullSource blobSource sourceBlob :: FilePath -> Maybe Language -> Source -> Blob -sourceBlob filepath language source = Blob source nullOid filepath defaultPlainBlob language +sourceBlob filepath language source = Blob source nullOid filepath language nullOid :: ByteString nullOid = "0000000000000000000000000000000000000000" diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index aa704c7ef..0fcbef5d2 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -253,4 +253,4 @@ blankDiff = merge (arrayInfo, arrayInfo) (Indexed [ inserting (Term $ literalInf literalInfo = Nothing :. Range 1 2 :. StringLiteral :. sourceSpanBetween (1, 2) (1, 4) :. Nil blankDiffBlobs :: Both Blob -blankDiffBlobs = both (Blob (fromText "[]") nullOid "a.js" defaultPlainBlob (Just TypeScript)) (Blob (fromText "[a]") nullOid "b.js" defaultPlainBlob (Just TypeScript)) +blankDiffBlobs = both (Blob (fromText "[]") nullOid "a.js" (Just TypeScript)) (Blob (fromText "[a]") nullOid "b.js" (Just TypeScript)) diff --git a/test/Semantic/Spec.hs b/test/Semantic/Spec.hs index c417cc54f..6e10ff6b8 100644 --- a/test/Semantic/Spec.hs +++ b/test/Semantic/Spec.hs @@ -37,4 +37,4 @@ spec = parallel $ do result `shouldBe` (Diff (Patch (Delete (In () []))) :: Diff [] () ()) where - methodsBlob = Blob "def foo\nend\n" "ff7bbbe9495f61d9e1e58c597502d152bab1761e" "methods.rb" defaultPlainBlob (Just Ruby) + methodsBlob = Blob "def foo\nend\n" "ff7bbbe9495f61d9e1e58c597502d152bab1761e" "methods.rb" (Just Ruby)