@@ -10,6 +10,9 @@ class Git(Tool):
1010 name = "git"
1111 full_name = "Git"
1212
13+ MIN_VERSION = (2 , 17 , 0 )
14+ GIT_URL = "https://git-scm.com/"
15+
1316 @classmethod
1417 def verify_install (cls , tools : ToolCache , ** kwargs ) -> ModuleType :
1518 """Verify if git is installed.
@@ -42,14 +45,14 @@ def verify_install(cls, tools: ToolCache, **kwargs) -> ModuleType:
4245 # for this.
4346 if tools .host_os == "Darwin" :
4447 raise BriefcaseCommandError (
45- """\
48+ f """\
4649 Briefcase requires git, but it is not installed. Xcode provides git; you should
4750be shown a dialog prompting you to install Xcode and the Command Line Developer
4851Tools. Select "Install" to install the Command Line Developer Tools.
4952
5053Alternatively, you can visit:
5154
52- https://git-scm.com/
55+ { cls . GIT_URL }
5356
5457to download and install git manually.
5558
@@ -60,10 +63,10 @@ def verify_install(cls, tools: ToolCache, **kwargs) -> ModuleType:
6063
6164 else :
6265 raise BriefcaseCommandError (
63- """\
66+ f """\
6467 Briefcase requires git, but it is not installed (or is not on your PATH). Visit:
6568
66- https://git-scm.com/
69+ { cls . GIT_URL }
6770
6871to download and install git manually.
6972
@@ -72,6 +75,16 @@ def verify_install(cls, tools: ToolCache, **kwargs) -> ModuleType:
7275"""
7376 ) from e
7477
78+ installed_version = git .cmd .Git ().version_info
79+ if installed_version < cls .MIN_VERSION :
80+ raise BriefcaseCommandError (
81+ f"At least Git v{ '.' .join (map (str , cls .MIN_VERSION ))} is required; "
82+ f"however, v{ '.' .join (map (str , installed_version ))} is installed.\n "
83+ "\n "
84+ f"Please update Git; downloads are available at { cls .GIT_URL } ." ,
85+ skip_logfile = True ,
86+ )
87+
7588 tools .logger .configure_stdlib_logging ("git" )
7689
7790 tools .git = git
0 commit comments