Add limit on git clone depth

Only checkout last 50 commits from a remote repository. This helps speed
up the cloning for large repositories.
pull/120/head
Tim Head 2017-10-24 23:28:36 +02:00
rodzic d4518285a1
commit 8caeffdbbd
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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: