Refuse to build with git older than 1.7.1.1, which is needed for git checkout -B

This commit is contained in:
Joey Hess 2014-01-13 15:17:48 -04:00
parent 0cac4402ac
commit 5a5adc44f5
3 changed files with 22 additions and 2 deletions

View file

@ -10,6 +10,7 @@ import System.FilePath
import System.Environment (getArgs)
import Data.Maybe
import Control.Monad.IfElse
import Control.Monad
import Data.Char
import Build.TestConfig
@ -95,8 +96,12 @@ getUpgradeLocation = do
return $ Config "upgradelocation" $ MaybeStringConfig e
getGitVersion :: Test
getGitVersion = Config "gitversion" . StringConfig . show
<$> Git.Version.installed
getGitVersion = do
v <- Git.Version.installed
let oldestallowed = Git.Version.normalize "1.7.1.0"
when (v < oldestallowed) $
error $ "installed git version " ++ show v ++ " is too old! (Need " ++ show oldestallowed ++ " or newer)"
return $ Config "gitversion" $ StringConfig $ show v
getSshConnectionCaching :: Test
getSshConnectionCaching = Config "sshconnectioncaching" . BoolConfig <$>