Merge pull request #3205 from openchamber/fix/branch-selector-remote-checkout

fix(git): check out a local tracking branch when a remote branch is picked
This commit is contained in:
Bohdan Triapitsyn
2026-08-28 16:21:40 +03:00
committed by GitHub
7 changed files with 190 additions and 10 deletions
+4 -2
View File
@@ -1347,8 +1347,10 @@ export const GitView: React.FC<GitViewProps> = ({ isActive }) => {
}
try {
await git.checkoutBranch(currentDirectory, normalized);
toast.success(t('gitView.toast.checkedOut', { name: normalized }));
// Picking a remote-tracking branch checks out the local branch that
// tracks it, so report the branch the repository actually landed on.
const result = await git.checkoutBranch(currentDirectory, normalized);
toast.success(t('gitView.toast.checkedOut', { name: result?.branch || normalized }));
await refreshStatusAndBranches();
await refreshLog();
} catch (err) {