Fix a bug in find --branch in the previous version
inAnnex check was lost for that code path. To avoid more such mistakes, made withKeyOptions check it when the AnnexedFileSeeker specifies.
This commit is contained in:
parent
2d771a7d32
commit
00865cdae8
12 changed files with 20 additions and 14 deletions
|
@ -166,21 +166,27 @@ withNothing _ _ = giveup "This command takes no parameters."
|
|||
withKeyOptions
|
||||
:: Maybe KeyOptions
|
||||
-> Bool
|
||||
-> AnnexedFileSeeker
|
||||
-> ((Key, ActionItem) -> CommandSeek)
|
||||
-> ([WorkTreeItem] -> CommandSeek)
|
||||
-> [WorkTreeItem]
|
||||
-> CommandSeek
|
||||
withKeyOptions ko auto keyaction = withKeyOptions' ko auto mkkeyaction
|
||||
withKeyOptions ko auto seeker keyaction = withKeyOptions' ko auto mkkeyaction
|
||||
where
|
||||
mkkeyaction = do
|
||||
matcher <- Limit.getMatcher
|
||||
return $ \v@(k, ai) ->
|
||||
return $ \v@(k, ai) -> checkseeker k $
|
||||
let i = case ai of
|
||||
ActionItemBranchFilePath (BranchFilePath _ topf) _ ->
|
||||
MatchingKey k (AssociatedFile $ Just $ getTopFilePath topf)
|
||||
_ -> MatchingKey k (AssociatedFile Nothing)
|
||||
in whenM (matcher i) $
|
||||
keyaction v
|
||||
checkseeker k a = case checkContentPresent seeker of
|
||||
Nothing -> a
|
||||
Just v -> do
|
||||
present <- inAnnex k
|
||||
when (present == v) a
|
||||
|
||||
withKeyOptions'
|
||||
:: Maybe KeyOptions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue