mirror of
https://github.com/github/semantic.git
synced 2024-11-29 02:44:36 +03:00
Simplify how we deal with empty source blobs.
This commit is contained in:
parent
39abcaa282
commit
ceecfa00b1
@ -36,7 +36,7 @@ main = do
|
||||
blobs <- traverse readFile paths
|
||||
terms <- traverse (traverse parseBlob) blobs
|
||||
diff' <- runBothWith maybeDiff terms
|
||||
return [(fromMaybe <$> (emptySourceBlob <$> paths) <*> blobs, diff')]
|
||||
return [(fromMaybe . emptySourceBlob <$> paths <*> blobs, diff')]
|
||||
CommitDiff -> do
|
||||
blobPairs <- readFilesAtSHAs gitDir alternateObjectDirs filePaths (fromMaybe (toS nullOid) (fst shaRange)) (fromMaybe (toS nullOid) (snd shaRange))
|
||||
for blobPairs . uncurry $ \ path blobs -> do
|
||||
|
@ -123,7 +123,7 @@ testDiff renderer paths expectedOutput = do
|
||||
blobs <- traverse readFile paths
|
||||
terms <- traverse (traverse parseBlob) blobs
|
||||
Just diff' <- runBothWith maybeDiff terms
|
||||
return (fromMaybe <$> (emptySourceBlob <$> paths) <*> blobs, diff')
|
||||
return (fromMaybe . emptySourceBlob <$> paths <*> blobs, diff')
|
||||
let diffOutput = renderer blobs diff'
|
||||
let actual = Verbatim (stripWhitespace diffOutput)
|
||||
expected <- Verbatim . stripWhitespace <$> B.readFile expectedOutput
|
||||
|
Loading…
Reference in New Issue
Block a user