Skip to content

Commit 7ed9e12

Browse files
committed
fix stale ref
1 parent 4f1a95e commit 7ed9e12

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/treeProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ export class GitTreeCompareProvider implements TreeDataProvider<Element>, Dispos
13941394

13951395
// Set upstream to origin/<headRef> if the branch exists there
13961396
try {
1397-
await repository.exec(['rev-parse', '--verify', `origin/${headRef}`]);
1397+
// Fetch the actual head ref to update the remote tracking branch
1398+
await repository.fetch({ remote: 'origin', ref: headRef });
13981399
await repository.exec(['branch', '--set-upstream-to', `origin/${headRef}`, localBranchName]);
13991400
this.log(`Created local branch ${localBranchName} tracking origin/${headRef}`);
14001401
} catch {

0 commit comments

Comments
 (0)