From d8b965a0aa800cf0a183e868fe5ac57aecf603e7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 Nov 2013 06:50:20 -0400 Subject: Allow use of --unused in bare repository. --- Seek.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Seek.hs') diff --git a/Seek.hs b/Seek.hs index 7f74f6728..b2782fc36 100644 --- a/Seek.hs +++ b/Seek.hs @@ -141,13 +141,15 @@ withNothing _ _ = error "This command takes no parameters." withKeyOptions :: (Key -> CommandStart) -> CommandSeek -> CommandSeek withKeyOptions keyop fallbackop params = do bare <- fromRepo Git.repoIsLocalBare - allkeys <- Annex.getFlag "all" <||> pure bare + allkeys <- Annex.getFlag "all" unused <- Annex.getFlag "unused" auto <- Annex.getState Annex.auto - case (allkeys , unused, auto ) of + case (allkeys || bare , unused, auto ) of (True , False , False) -> go loggedKeys (False , True , False) -> go unusedKeys - (True , True , _ ) -> error "Cannot use --all with --unused." + (True , True , _ ) + | bare && not allkeys -> go unusedKeys + | otherwise -> error "Cannot use --all with --unused." (False , False , _ ) -> fallbackop params (_ , _ , True ) | bare -> error "Cannot use --auto in a bare repository." -- cgit v1.2.3