Skip to content

Commit bf6d323

Browse files
authored
This reverts commit 6011bf7.
1 parent 4a6add4 commit bf6d323

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extensions/git/src/git.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,7 @@ export class Repository {
20282028

20292029
if (branchName.startsWith('refs/heads/')) {
20302030
branchName = branchName.substring(11);
2031+
const index = upstream.indexOf('/');
20312032

20322033
let ahead;
20332034
let behind;
@@ -2040,8 +2041,8 @@ export class Repository {
20402041
type: RefType.Head,
20412042
name: branchName,
20422043
upstream: upstream ? {
2043-
name: upstream.substring(upstream.length - branchName.length),
2044-
remote: upstream.substring(0, upstream.length - branchName.length - 1)
2044+
name: upstream.substring(index + 1),
2045+
remote: upstream.substring(0, index)
20452046
} : undefined,
20462047
commit: ref || undefined,
20472048
ahead: Number(ahead) || 0,

0 commit comments

Comments
 (0)