diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-27 06:50:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-27 06:50:20 -0400 |
commit | d8b965a0aa800cf0a183e868fe5ac57aecf603e7 (patch) | |
tree | b4c816468851befd594fac4122c3fca73d6d991e /Seek.hs | |
parent | 0820d72ce3808d373f8334a12256ee65217f596b (diff) |
Allow use of --unused in bare repository.
Diffstat (limited to 'Seek.hs')
-rw-r--r-- | Seek.hs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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." |