limit git annex adjust to v6 mode
doesn't work in v5
This commit is contained in:
parent
f4dd3fbb68
commit
5e1d7bbc00
2 changed files with 6 additions and 0 deletions
|
@ -52,6 +52,9 @@ versionSupportsUnlockedPointers = go <$> getVersion
|
||||||
go (Just "6") = True
|
go (Just "6") = True
|
||||||
go _ = False
|
go _ = False
|
||||||
|
|
||||||
|
versionSupportsAdjustedBranch :: Annex Bool
|
||||||
|
versionSupportsAdjustedBranch = versionSupportsUnlockedPointers
|
||||||
|
|
||||||
setVersion :: Version -> Annex ()
|
setVersion :: Version -> Annex ()
|
||||||
setVersion = setConfig versionField
|
setVersion = setConfig versionField
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ module Command.Adjust where
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
import Annex.AdjustedBranch
|
import Annex.AdjustedBranch
|
||||||
|
import Annex.Version
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ notDirect $
|
cmd = notBareRepo $ notDirect $
|
||||||
|
@ -33,5 +34,7 @@ seek = commandAction . start
|
||||||
|
|
||||||
start :: Adjustment -> CommandStart
|
start :: Adjustment -> CommandStart
|
||||||
start adj = do
|
start adj = do
|
||||||
|
unlessM versionSupportsAdjustedBranch $
|
||||||
|
error "Adjusted branches are only supported in v6 or newer repositories."
|
||||||
enterAdjustedBranch adj
|
enterAdjustedBranch adj
|
||||||
next $ next $ return True
|
next $ next $ return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue