@@ -53,6 +53,7 @@ import type { GitBlame, GitBlameAuthor, GitBlameLine, GitBlameLines } from '../.
5353import type { BranchSortOptions } from '../../../git/models/branch' ;
5454import {
5555 getBranchId ,
56+ getBranchNameAndRemote ,
5657 getBranchNameWithoutRemote ,
5758 getRemoteNameFromBranchName ,
5859 GitBranch ,
@@ -92,7 +93,6 @@ import {
9293 isUncommitted ,
9394 isUncommittedStaged ,
9495 shortenRevision ,
95- splitRefNameAndRemote ,
9696} from '../../../git/models/reference' ;
9797import type { GitReflog } from '../../../git/models/reflog' ;
9898import { getRemoteIconUri , getVisibilityCacheKey , GitRemote } from '../../../git/models/remote' ;
@@ -1165,13 +1165,12 @@ export class LocalGitProvider implements GitProvider, Disposable {
11651165 const { branch, ...opts } = options ?? { } ;
11661166 try {
11671167 if ( isBranchReference ( branch ) ) {
1168- if ( ! branch ?. remote && branch ?. upstream == null ) return undefined ;
1169-
1170- const [ branchName , remoteName ] = splitRefNameAndRemote ( branch ) ;
1168+ const [ branchName , remoteName ] = getBranchNameAndRemote ( branch ) ;
1169+ if ( remoteName == null ) return undefined ;
11711170
11721171 await this . git . fetch ( repoPath , {
11731172 branch : branchName ,
1174- remote : remoteName ! ,
1173+ remote : remoteName ,
11751174 upstream : getBranchTrackingWithoutRemote ( branch ) ! ,
11761175 pull : options ?. pull ,
11771176 } ) ;
@@ -1202,7 +1201,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
12021201 if ( branch == null ) return undefined ;
12031202 }
12041203
1205- const [ branchName , remoteName ] = splitRefNameAndRemote ( branch ) ;
1204+ const [ branchName , remoteName ] = getBranchNameAndRemote ( branch ) ;
12061205 if ( options ?. publish == null && remoteName == null && branch . upstream == null ) {
12071206 return undefined ;
12081207 }
@@ -1239,7 +1238,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
12391238 if ( branch == null ) return undefined ;
12401239 }
12411240
1242- const [ branchName , remoteName ] = splitRefNameAndRemote ( branch ) ;
1241+ const [ branchName , remoteName ] = getBranchNameAndRemote ( branch ) ;
12431242 if ( remoteName == null && branch . upstream == null ) return undefined ;
12441243
12451244 try {
0 commit comments