fix(git): check out a local tracking branch when a remote branch is picked

This commit is contained in:
Iuliia Ivashko
2026-08-28 15:45:43 +03:00
parent 73e21d0050
commit 01b3e3346f
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) {