Skip to content

Commit a8490ef

Browse files
PDP-962: Use full clone instead of shallow clone
1 parent 02c701e commit a8490ef

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

github-app/app.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,8 @@ def download_files(self, file_paths):
313313
base_clone_dir = os.path.join(self.temp_dir, 'base_repo')
314314
token = self.headers['Authorization'].replace('token ','')
315315
auth_clone_url = f"https://x-access-token:{token}@{GHES_URL.replace('https://','')}/{self.repo_full_name}.git"
316-
# Calculate date 30 days ago for consistent shallow clone across environments
317-
from datetime import datetime, timedelta
318-
thirty_days_ago = (datetime.now() - timedelta(days=30)).strftime('%Y-%m-%d')
319-
clone_res = subprocess.run(['git','clone','--shallow-since', thirty_days_ago,'--branch', self.pr_data['base']['ref'], auth_clone_url, base_clone_dir], capture_output=True, text=True, timeout=60)
316+
# Fast full clone - single branch, no tags for speed and reliability
317+
clone_res = subprocess.run(['git', 'clone', '--single-branch', '--no-tags', '--branch', self.pr_data['base']['ref'], auth_clone_url, base_clone_dir], capture_output=True, text=True, timeout=120)
320318
if clone_res.returncode != 0:
321319
raise Exception(f"Git clone failed: {clone_res.stderr}")
322320
# Apply diff with 3-way merge and whitespace fix

0 commit comments

Comments
 (0)