improve type
This commit is contained in:
parent
4694e49158
commit
e662aceeac
2 changed files with 4 additions and 3 deletions
|
@ -77,12 +77,12 @@ withFilesNotInGit skipdotfiles a params
|
||||||
go l = seekActions $ prepFiltered a $
|
go l = seekActions $ prepFiltered a $
|
||||||
return $ concat $ segmentPaths params l
|
return $ concat $ segmentPaths params l
|
||||||
|
|
||||||
withFilesInRefs :: (FilePath -> Key -> CommandStart) -> CmdParams -> CommandSeek
|
withFilesInRefs :: (FilePath -> Key -> CommandStart) -> [Git.Ref] -> CommandSeek
|
||||||
withFilesInRefs a = mapM_ go
|
withFilesInRefs a = mapM_ go
|
||||||
where
|
where
|
||||||
go r = do
|
go r = do
|
||||||
matcher <- Limit.getMatcher
|
matcher <- Limit.getMatcher
|
||||||
(l, cleanup) <- inRepo $ LsTree.lsTree (Git.Ref r)
|
(l, cleanup) <- inRepo $ LsTree.lsTree r
|
||||||
forM_ l $ \i -> do
|
forM_ l $ \i -> do
|
||||||
let f = getTopFilePath $ LsTree.file i
|
let f = getTopFilePath $ LsTree.file i
|
||||||
v <- catKey (LsTree.sha i)
|
v <- catKey (LsTree.sha i)
|
||||||
|
|
|
@ -9,6 +9,7 @@ module Command.FindRef where
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
import qualified Command.Find as Find
|
import qualified Command.Find as Find
|
||||||
|
import qualified Git
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions nonWorkTreeMatchingOptions $ Find.mkCommand $
|
cmd = withGlobalOptions nonWorkTreeMatchingOptions $ Find.mkCommand $
|
||||||
|
@ -17,4 +18,4 @@ cmd = withGlobalOptions nonWorkTreeMatchingOptions $ Find.mkCommand $
|
||||||
paramRef (seek <$$> Find.optParser)
|
paramRef (seek <$$> Find.optParser)
|
||||||
|
|
||||||
seek :: Find.FindOptions -> CommandSeek
|
seek :: Find.FindOptions -> CommandSeek
|
||||||
seek o = Find.start o `withFilesInRefs` Find.findThese o
|
seek o = Find.start o `withFilesInRefs` (map Git.Ref $ Find.findThese o)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue