guard against unsafe git ls-files uses
authorJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 19:55:34 +0000 (15:55 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 19:55:34 +0000 (15:55 -0400)
This breaks several parts of the upgrade code, when upgrading remotes
of the current repo, but those parts were buggy, and will need to be
fixed somehow anyway.

Git/LsFiles.hs

index c15397a7553f4237d0d2d866de48340ff2b9cba3..31a74d42838a5a450cf63b24327f86b66cfcd873 100644 (file)
@@ -320,7 +320,7 @@ reduceUnmerged c (i:is) = reduceUnmerged (new:c) rest
  - point in the future. If the output is not as expected, will use Nothing.
  -}
 inodeCaches :: [RawFilePath] -> Repo -> IO ([(FilePath, Maybe InodeCache)], IO Bool)
-inodeCaches locs repo = do
+inodeCaches locs repo = guardSafeForLsFiles repo $ do
        (ls, cleanup) <- pipeNullSplit params repo
        return (parse Nothing (map decodeBL ls), cleanup)
   where