issue:checkout: fetch remote before checkout when remote already exists#330
issue:checkout: fetch remote before checkout when remote already exists#330
Conversation
Co-authored-by: mglaman <3698644+mglaman@users.noreply.github.com> Agent-Logs-Url: https://github.com/mglaman/drupalorg-cli/sessions/90a6c0b6-a6a3-4e52-b398-95a0e564634a
There was a problem hiding this comment.
Pull request overview
This PR fixes issue:checkout failing to track a remote branch when the issue fork remote already exists locally by ensuring the remote is fetched before attempting the checkout.
Changes:
- When the expected remote already exists, run
git fetch <remote>beforegit checkout -b ... --track .... - Surface a clear fetch failure message and exit early if the fetch fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot I didn't have the remote setup, can we verify , |
Yes — |
issue:checkoutonly fetched the remote when it was being newly added. If the remote already existed locally (manually added, or stale from a previous session), no fetch occurred before the checkout attempt, causinggit checkout -b <branch> --track <remote>/<branch>to fail with a missing ref error.Changes
Checkout.php: Addedgit fetch <remote>in the branch where the remote already exists, ensuring local tracking refs are always up-to-date before the checkout. Fetch failure surfaces an explicit error message and exits early.The "remote not found" path (via
SetupIssueRemoteAction) already fetched after adding — this change closes the gap for the pre-existing remote case.Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.