Clone git repository with a depth of one.

This avoid downloading all the history.

With recent git, a `git fetch --unshallow` allow a user to get all
the history if needed.
This commit is contained in:
Matthieu Gautier 2017-04-18 13:24:23 +02:00
parent 6d13ee8a4e
commit 0199092f62
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ class GitClone(Source):
context.force_native_build = True
if os.path.exists(self.git_path):
raise SkipCommand()
command = "git clone {} {}".format(self.git_remote, self.git_dir)
command = "git clone --depth=1 {} {}".format(self.git_remote, self.git_dir)
self.buildEnv.run_command(command, self.buildEnv.source_dir, context)
def _git_update(self, context):