Skip to content

Commit

Permalink
[Chore] Use proc instead of shell to call git
Browse files Browse the repository at this point in the history
Use `proc` to avoid the overhead and security considerations of `shell`.
  • Loading branch information
int-index committed Jan 1, 2025
1 parent 224ccb0 commit c011b21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Xrefcheck/Scan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Data.Map qualified as M
import Data.Reflection (Given)
import Fmt (Buildable (..), Builder, fmtLn)
import System.Directory (doesDirectoryExist, pathIsSymbolicLink)
import System.Process (cwd, readCreateProcess, shell)
import System.Process (cwd, readCreateProcess, proc)
import Text.Interpolation.Nyan
import Text.Regex.TDFA.Common (CompOption (..), ExecOption (..), Regex)
import Text.Regex.TDFA.Text qualified as R
Expand Down Expand Up @@ -185,9 +185,9 @@ readDirectoryWith mode config scanner root = do
RdmBothTrackedAndUtracked -> liftA2 (<>) getTrackedFiles getUntrackedFiles

getTrackedFiles = readCreateProcess
(shell "git ls-files -z"){cwd = Just root} ""
(proc "git" ["ls-files", "-z"]){cwd = Just root} ""
getUntrackedFiles = readCreateProcess
(shell "git ls-files -z --others --exclude-standard"){cwd = Just root} ""
(proc "git" ["ls-files", "-z", "--others", "--exclude-standard"]){cwd = Just root} ""

fileLines :: String -> [String]
fileLines (dropWhile (== '\0') -> ls) =
Expand Down

0 comments on commit c011b21

Please sign in to comment.