don't let git-annex direct be run in a v6 repo

This commit is contained in:
Joey Hess 2015-12-04 16:29:27 -04:00
parent ccc49861ca
commit e7f75b079d
Failed to extract signature
6 changed files with 26 additions and 6 deletions

View file

@ -14,6 +14,7 @@ import qualified Git.LsFiles
import qualified Git.Branch
import Config
import Annex.Direct
import Annex.Version
cmd :: Command
cmd = notBareRepo $ noDaemonRunning $
@ -24,7 +25,10 @@ seek :: CmdParams -> CommandSeek
seek = withNothing start
start :: CommandStart
start = ifM isDirect ( stop , next perform )
start = ifM versionSupportsDirectMode
( ifM isDirect ( stop , next perform )
, error "Direct mode is not suppported by this repository version. Use git-annex unlock instead."
)
perform :: CommandPerform
perform = do