convert notBareRepo to a CommandCheck
This avoids some small overhead by only running the check once per command; it also ensures that, even if the command doesn't find anything to run on, it still fails to run when in a bare repo.
This commit is contained in:
parent
e2788a5d15
commit
e872c3f648
10 changed files with 26 additions and 28 deletions
|
@ -16,15 +16,14 @@ import Config
|
|||
import Annex.Direct
|
||||
|
||||
def :: [Command]
|
||||
def = [command "direct" paramNothing seek "switch repository to direct mode"]
|
||||
def = [notBareRepo $
|
||||
command "direct" paramNothing seek "switch repository to direct mode"]
|
||||
|
||||
seek :: [CommandSeek]
|
||||
seek = [withNothing start]
|
||||
|
||||
start :: CommandStart
|
||||
start = notBareRepo $
|
||||
ifM isDirect
|
||||
( stop , next perform )
|
||||
start = ifM isDirect ( stop , next perform )
|
||||
|
||||
perform :: CommandPerform
|
||||
perform = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue