Skip to content

Commit 5afbcb0

Browse files
Speed up initial docs generation by setting the git clone depth to 1. (#2093)
* Speed up initial docs cloning --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0907b32 commit 5afbcb0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/management/commands/update_docs.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,17 @@ def update_git(self, url, destdir, changed_dir="."):
358358
os.chdir(cwd)
359359
else:
360360
subprocess.check_call(
361-
["git", "clone", "--branch", branch, repo, str(destdir), quiet],
361+
[
362+
"git",
363+
"clone",
364+
"--depth",
365+
"1",
366+
"--branch",
367+
branch,
368+
repo,
369+
str(destdir),
370+
quiet,
371+
],
362372
stderr=sys.stdout,
363373
)
364374
return True

0 commit comments

Comments
 (0)