Skip to content

Commit c8626b1

Browse files
gerbsenclaude
andauthored
Speed up getDocs clones with shallow, single-branch fetch (#383)
getDocs.js only needs a snapshot of each upstream repo's docs, but it did a full clone (entire history, all branches). Add --depth 1 so each clone transfers only the latest commit of the default branch, cutting fetch time and bandwidth noticeably for the larger source repositories. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Daniel Gerber <394442-gerbsen@users.noreply.gitlab.com>
1 parent 7c475d6 commit c8626b1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

getDocs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const cloneUrl = (repo) =>
2020
repos.forEach((repo) => {
2121
const repoDir = `repo_to_be_edited/${repo.label}`
2222

23-
// Clone the repository
24-
const cloneCommand = `git clone ${cloneUrl(repo.repo)} ${repoDir}`
23+
// Clone the repository (shallow, single branch — we only need a snapshot of the docs)
24+
const cloneCommand = `git clone --depth 1 ${cloneUrl(repo.repo)} ${repoDir}`
2525
execSync(cloneCommand)
2626

2727
// Remove git folders

0 commit comments

Comments
 (0)