Skip to content

Instantly share code, notes, and snippets.

@cotto
Created February 24, 2013 20:33
Show Gist options
  • Save cotto/5025496 to your computer and use it in GitHub Desktop.
Save cotto/5025496 to your computer and use it in GitHub Desktop.
use shallow clones for gen-parrot
diff --git a/tools/lib/NQP/Configure.pm b/tools/lib/NQP/Configure.pm
index ac397e1..1d6e7d1 100644
--- a/tools/lib/NQP/Configure.pm
+++ b/tools/lib/NQP/Configure.pm
@@ -203,20 +203,14 @@ sub git_checkout {
# get an up-to-date repository
if (! -d $dir) {
- system_or_die('git', 'clone', $repo, $dir);
+ system_or_die('git', 'clone', '--depth', '1', '--branch', $checkout, $repo, $dir);
chdir($dir);
system('git', 'config', 'remote.origin.pushurl', $pushurl)
if defined $pushurl;
}
else {
chdir($dir);
- system_or_die('git', 'fetch');
- }
-
- if ($checkout) {
- system_or_die('git', 'checkout', $checkout);
- system_or_die('git', 'pull')
- if slurp('.git/HEAD') =~ /^ref:/;
+ system_or_die('git', 'fetch', 'origin', $checkout);
}
my $git_describe;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment