1
1
mirror of https://github.com/github/semantic.git synced 2025-01-08 08:30:27 +03:00

Unique the list of paths.

This commit is contained in:
Rob Rix 2017-04-07 10:49:36 -04:00
parent 3c596fb980
commit 2d0b3ff4b1

View File

@ -22,7 +22,7 @@ import Control.Monad.IO.Class
import Control.Parallel.Strategies
import qualified Data.ByteString as B
import Data.Functor.Both
import Data.List ((\\))
import Data.List ((\\), nub)
import Data.RandomWalkSimilarity
import Data.Record
import Data.String
@ -140,7 +140,7 @@ runReadFilesAtSHAs gitDir alternateObjectDirs paths shas = do
[] -> runGit $ do
trees <- for shas treeForSha
paths <- for trees (reportGitmon "ls-tree" . treeBlobEntries)
pure $! (\ (p, _, _) -> toS p) <$> runBothWith (\\) paths <> runBothWith (flip (\\)) paths
pure . nub $! (\ (p, _, _) -> toS p) <$> runBothWith (\\) paths <> runBothWith (flip (\\)) paths
_ -> pure paths
Async.withTaskGroup numCapabilities (\ group -> Async.runTask group (traverse (Async.task . runGit . blobsForPath) paths))