summaryrefslogtreecommitdiff
path: root/Seek.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-04-08 12:25:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-04-08 12:25:54 -0400
commit182778d664f5e7fb66e1422a6d429a604d083fa3 (patch)
treeebf9b7bc475ed075a6c2cc1ecffa7b1e0970ace6 /Seek.hs
parent4309f363fb2e779856092f10b53fa7c6e88a6ea3 (diff)
bugfix: Adding a dotfile also caused all non-dotfiles to be added.
When only a dotfile was specified, the list of non-dotfiles was empty, triggering the fallback behavior of finding all files.
Diffstat (limited to 'Seek.hs')
-rw-r--r--Seek.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Seek.hs b/Seek.hs
index 7a53fc04b..8d4f917e7 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -29,12 +29,14 @@ withFilesInGit a params = prepFiltered a $ seekHelper LsFiles.inRepo params
withFilesNotInGit :: (FilePath -> CommandStart) -> CommandSeek
withFilesNotInGit a params = do
{- dotfiles are not acted on unless explicitly listed -}
- files <- filter (not . dotfile) <$> seek ps
- dotfiles <- if null dotps then return [] else seek dotps
+ files <- filter (not . dotfile) <$>
+ seekunless (null ps && not (null params)) ps
+ dotfiles <- seekunless (null dotps) dotps
prepFiltered a $ return $ preserveOrder params (files++dotfiles)
where
(dotps, ps) = partition dotfile params
- seek l = do
+ seekunless True _ = return []
+ seekunless _ l = do
force <- Annex.getState Annex.force
g <- gitRepo
liftIO $ (\p -> LsFiles.notInRepo force p g) l