We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a6add4 commit bf6d323Copy full SHA for bf6d323
extensions/git/src/git.ts
@@ -2028,6 +2028,7 @@ export class Repository {
2028
2029
if (branchName.startsWith('refs/heads/')) {
2030
branchName = branchName.substring(11);
2031
+ const index = upstream.indexOf('/');
2032
2033
let ahead;
2034
let behind;
@@ -2040,8 +2041,8 @@ export class Repository {
2040
2041
type: RefType.Head,
2042
name: branchName,
2043
upstream: upstream ? {
- name: upstream.substring(upstream.length - branchName.length),
2044
- remote: upstream.substring(0, upstream.length - branchName.length - 1)
+ name: upstream.substring(index + 1),
2045
+ remote: upstream.substring(0, index)
2046
} : undefined,
2047
commit: ref || undefined,
2048
ahead: Number(ahead) || 0,
0 commit comments