Add limit on git clone depth
Only checkout last 50 commits from a remote repository. This helps speed
up the cloning for large repositories.
MODIFY
repo2docker/app.py
repo2docker/app.py
@@ -92,7 +92,8 @@ class Repo2Docker(Application):
def fetch(self, url, ref, checkout_path):
try:
- for line in execute_cmd(['git', 'clone', url, checkout_path],
+ for line in execute_cmd(['git', 'clone', '--depth', '50',
+ url, checkout_path],
capture=self.json_logs):
self.log.info(line, extra=dict(phase='fetching'))
except subprocess.CalledProcessError:

Add limit on git clone depth

Only checkout last 50 commits from a remote repository. This helps speed
up the cloning for large repositories.