-
Notifications
You must be signed in to change notification settings - Fork 208
fix(web): Fixed issue where Sourcebot would not index the new default branch when changed #789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
WalkthroughDetects remote default branch during fetch, optionally updates local HEAD to that branch, exposes helpers to read remote/local default branch, uses local default branch for initial revision selection during indexing, and makes branch-display visibility in the UI query-driven. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/backend/src/git.ts (1)
147-150: Guard cleanup to avoid masking fetch errors.In the finally block (line 150),
git config --unsetfails with exit code 5 when the key is missing or the value pattern doesn't match, which would replace the original error caught in the except block. Wrap the cleanup in its own try-catch to prevent error masking.Suggested fix
} finally { if (authHeader) { - await git.raw(["config", "--unset", "http.extraHeader", authHeader]); + try { + await git.raw(["config", "--unset", "http.extraHeader", authHeader]); + } catch (error: unknown) { + logger.debug( + `Failed to unset http.extraHeader for ${path}: ${ + error instanceof Error ? error.message : error + }` + ); + } } }
6004a34 to
2fcae8d
Compare
This PR fixes the issue where when the default branch changes, new commits would not be re-indexed. The issue was that the
HEADsymbolic ref was not getting updated to the new default branch. This PR adds that.Additionally, this PR makes the default branch appear in most places instead of HEAD, where applicable.
Fixes #40
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.