SIGN IN SIGN UP

Fix: skip redundant git checkout when branch is already checked out

When checkout() is called for the current branch, skip the git
checkout command while still running the full operation lifecycle
(updating model state and firing onDidCheckout events). This allows
extensions like GitHub Pull Requests to safely call checkout()
unconditionally without needing their own 'already on branch' guard.

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/86a07518-2865-4107-8627-d5a4da7535cb

Co-authored-by: alexr00 <[email protected]>
C
copilot-swe-agent[bot] committed
7390bcf836b9370e8bd39d743859e442ec909fa3
Parent: c47b079
Committed by GitHub <[email protected]> on 3/30/2026, 9:02:38 AM