fix(desktop): prevent implicit upstream tracking when creating worktrees#491
Conversation
When creating a new branch from a remote branch (e.g., origin/main),
Git implicitly sets upstream tracking to that remote branch. This causes
git pull to pull from the base branch instead of the new branch's remote.
By appending ^{commit} to the startPoint, Git treats it as a commit
object rather than a branch ref, preventing implicit upstream tracking.
The new branch starts with no upstream, which matches the 'new branch'
intent and allows push.autoSetupRemote to work correctly on first push.
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/desktop/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
Files:
🔇 Additional comments (1)
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 |
|
Nice catch! Thanks for the PR @CalebBarnes 🥳 |
Description
When creating a new branch from a remote branch (e.g., origin/main), Git implicitly sets upstream tracking to that remote branch. This causes git pull to pull from the base branch instead of the new branch's remote.
By appending ^{commit} to the startPoint, Git treats it as a commit object rather than a branch ref, preventing implicit upstream tracking. The new branch starts with no upstream, which matches the 'new branch' intent and allows push.autoSetupRemote to work correctly on first push.
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.