fix: repair git sync shallow pulls#2176
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR refactors GitClient's pull mechanism to handle shallow clone failures. Instead of checking remote HEAD upfront, Pull now uses context-aware pulling and automatically recovers broken shallow checkouts by deepening the repository and retrying on object-not-found errors. ChangesShallow repository recovery and pull refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Repair git-sync pull failures for shallow internal repositories when the remote branch advances beyond the available local history.
Changes
Root Cause
Dagu cloned and fetched the git-sync repository with depth 1, then performed a separate pull. When the remote branch was more than one commit ahead, go-git could not walk the missing intermediate parent commits and returned object not found.
Related Issues
Reported by a user; no linked issue.
Checklist
Testing