summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-13 15:17:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-13 15:17:48 -0400
commit9d5e8dbc63ccbda4e2339a79c4c3938bb16d25f3 (patch)
tree2a19e3fbbcbb6ad5ade999fe98dbeb11a75c02a6 /Build
parent45c39a20a4ded47f0775c113b50735326558cf17 (diff)
Refuse to build with git older than 1.7.1.1, which is needed for git checkout -B
Diffstat (limited to 'Build')
-rw-r--r--Build/Configure.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs
index da66aacf2..487ed9b10 100644
--- a/Build/Configure.hs
+++ b/Build/Configure.hs
@@ -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 <$>