@@ -180,8 +180,11 @@ defmodule Mix.SCM.Git do
180
180
end
181
181
end
182
182
183
+ @ min_git_version_sparse { 1 , 7 , 4 }
184
+ @ min_git_version_progress { 1 , 7 , 1 }
185
+
183
186
defp check_sparse_support ( version ) do
184
- ensure_feature_compatibility ( version , { 1 , 7 , 4 } , "sparse checkout" )
187
+ ensure_feature_compatibility ( version , @ min_git_version_sparse , "sparse checkout" )
185
188
end
186
189
187
190
defp ensure_feature_compatibility ( version , required_version , feature ) do
@@ -194,7 +197,7 @@ defmodule Mix.SCM.Git do
194
197
end
195
198
196
199
defp progress_switch ( version ) do
197
- if { 1 , 7 , 1 } <= version , do: [ "--progress" ] , else: [ ]
200
+ if @ min_git_version_progress <= version , do: [ "--progress" ] , else: [ ]
198
201
end
199
202
200
203
defp tags_switch ( nil ) , do: [ ]
@@ -330,9 +333,16 @@ defmodule Mix.SCM.Git do
330
333
end
331
334
end
332
335
333
- # Also invoked by lib/mix/test/test_helper.exs
336
+ # Invoked by lib/mix/test/test_helper.exs
334
337
@ doc false
335
- def git_version do
338
+ def unsupported_options do
339
+ git_version = git_version ( )
340
+
341
+ [ ]
342
+ |> Kernel . ++ ( if git_version < @ min_git_version_sparse , do: [ :sparse ] , else: [ ] )
343
+ end
344
+
345
+ defp git_version do
336
346
case Mix.State . fetch ( :git_version ) do
337
347
{ :ok , version } ->
338
348
version
0 commit comments