diff --git a/lib/ES/BaseRepo.pm b/lib/ES/BaseRepo.pm index 63e6a9fb0a5c..7d261b900811 100644 --- a/lib/ES/BaseRepo.pm +++ b/lib/ES/BaseRepo.pm @@ -46,7 +46,7 @@ sub update_from_remote { unless ( $self->_try_to_fetch ) { my $url = $self->url; printf(" - %20s: Cloning from <%s>\n", $name, $url); - run 'git', 'clone', '--bare', $self->_reference_args, $url, $git_dir; + run 'git', 'clone', '--bare', '--no-tags', '--depth=1', $self->_reference_args, $url, $git_dir; } 1; } diff --git a/lib/ES/Repo.pm b/lib/ES/Repo.pm index 7d81531dac81..6a7ac979c4f7 100644 --- a/lib/ES/Repo.pm +++ b/lib/ES/Repo.pm @@ -277,6 +277,7 @@ sub _extract_from_ref { $dest->mkpath; my $tar = $dest->file( '.temp_git_archive.tar' ); die "File <$tar> already exists" if -e $tar; + run qw(git fetch --no-tags --depth=1 origin), $ref . ':' . $ref; run qw(git archive --format=tar -o), $tar, $ref, $path; run qw(tar -x -C), $dest, '-f', $tar; diff --git a/lib/ES/TargetRepo.pm b/lib/ES/TargetRepo.pm index c1514ab00967..5feb4459440d 100644 --- a/lib/ES/TargetRepo.pm +++ b/lib/ES/TargetRepo.pm @@ -48,7 +48,7 @@ sub checkout_minimal { my $original_pwd = Cwd::cwd(); eval { - my $out = run qw(git clone --no-checkout), + my $out = run qw(git clone --no-checkout --no-tags --depth=1), $self->git_dir, $self->{destination}; # This if statement handles empty repositories in a way that works with