@@ -211,11 +211,15 @@ sub git_checkout {
211
211
my $dir = shift ;
212
212
my $checkout = shift ;
213
213
my $pushurl = shift ;
214
+ my $git_depth = shift ;
215
+ my $depth = $git_depth ? ' --depth=' . $git_depth : ' ' ;
214
216
my $pwd = cwd();
215
217
216
218
# get an up-to-date repository
217
219
if (! -d $dir ) {
218
- system_or_die(' git' , ' clone' , $repo , $dir );
220
+ my @args = (' git' , ' clone' , $repo , $dir );
221
+ push @args , $depth if $depth ;
222
+ system_or_die(@args );
219
223
chdir ($dir );
220
224
system (' git' , ' config' , ' remote.origin.pushurl' , $pushurl )
221
225
if defined $pushurl && $pushurl ne $repo ;
@@ -317,6 +321,7 @@ sub gen_nqp {
317
321
github_url($git_protocol , ' perl6' , ' nqp' ),
318
322
' nqp' , $nqp_want ,
319
323
github_url(' ssh' , ' perl6' , ' nqp' ),
324
+ $options {' git-depth' },
320
325
);
321
326
}
322
327
@@ -369,6 +374,7 @@ sub gen_parrot {
369
374
github_url($git_protocol , ' parrot' , ' parrot' ),
370
375
' parrot' , $gen_parrot ,
371
376
github_url(' ssh' , ' parrot' , ' parrot' ),
377
+ $options {' git-depth' },
372
378
);
373
379
$par_ok = $par_have eq $par_repo ;
374
380
}
@@ -377,6 +383,7 @@ sub gen_parrot {
377
383
github_url($git_protocol , ' parrot' , ' parrot' ),
378
384
' parrot' , $par_want ,
379
385
github_url(' ssh' , ' parrot' , ' parrot' ),
386
+ $options {' git-depth' },
380
387
);
381
388
}
382
389
@@ -450,6 +457,7 @@ sub gen_moar {
450
457
github_url($git_protocol , ' MoarVM' , ' MoarVM' ),
451
458
' MoarVM' , $gen_moar || $moar_want ,
452
459
github_url(' ssh' , ' MoarVM' , ' MoarVM' ),
460
+ $options {' git-depth' },
453
461
);
454
462
455
463
unless (cmp_rev($moar_repo , $moar_want ) >= 0) {
0 commit comments