File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -495,16 +495,22 @@ cliTreeEntry tree fp = do
495
495
((_,x): _) -> Just x
496
496
497
497
cliSourceTreeEntries :: MonadCli m
498
- => Tree CliRepo
498
+ => Bool
499
+ -> Tree CliRepo
499
500
-> ConduitT i (TreeFilePath , TreeEntry CliRepo ) (ReaderT CliRepo m () )
500
- cliSourceTreeEntries tree = do
501
+ cliSourceTreeEntries recursive tree = do
501
502
contents <- lift $ do
502
503
toid <- treeOid tree
503
- runGit [ " ls-tree" , " -t" , " -r" , " -z"
504
+ runGit $ " ls-tree"
505
+ : " -t"
506
+ : consIf recursive " -r"
507
+ [ " -z"
504
508
, fromStrict (renderObjOid toid)
505
509
]
506
510
forM_ (L. init (TL. splitOn " \NUL " contents)) $
507
511
yield <=< lift . cliParseLsTree
512
+ where
513
+ consIf b x xs = if b then x: xs else xs
508
514
509
515
cliLookupCommit :: MonadCli m
510
516
=> CommitOid CliRepo -> ReaderT CliRepo m (Commit CliRepo )
You can’t perform that action at this time.
0 commit comments