Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions api/app/services/git_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,21 @@ async def clone_repo(clone_url: str, target_dir: Path, env: Optional[dict] = Non

process_env = {**os.environ, **(env or {})}

# Use partial clone (blob:none) to download commits/trees but not file contents initially.
process = await asyncio.create_subprocess_exec(
"git",
"-c",
"http.version=HTTP/1.1",
"-c",
"http.postBuffer=2097152000",
"-c",
"http.lowSpeedLimit=0",
"-c",
"http.lowSpeedTime=999999",
"-c",
"core.compression=0",
"clone",
"--filter=blob:none",
clone_url,
str(target_dir),
stdout=asyncio.subprocess.PIPE,
Expand All @@ -86,6 +96,14 @@ async def fetch_repo(target_dir: Path):
"git",
"-c",
"http.version=HTTP/1.1",
"-c",
"http.postBuffer=2097152000",
"-c",
"http.lowSpeedLimit=0",
"-c",
"http.lowSpeedTime=999999",
"-c",
"core.compression=0",
"-C",
str(target_dir),
"fetch",
Expand Down
Loading