1088
return {};
1089
}
1091
>
let upstreamBranchName: string | undefined;
1092
>
let outgoingChanges: number | undefined;
1093
>
let incomingChanges: number | undefined;
1094
>
let uncommittedChanges = 0;
1095
>
for (const rawLine of output.split(/\r?\n/g)) {
1096
>
const line = rawLine.trimEnd();
1097
>
if (!line) { continue; }
1098
>
if (line.startsWith('# branch.head ')) {
1099
>
const head = line.substring('# branch.head '.length).trim();
1100
>
// `(detached)` is what git emits for a detached HEAD. Treat as no branch.
1101
>
branchName = head === '(detached)' ? undefined : head;
1102
>
} else if (line.startsWith('# branch.upstream ')) {
1103
upstreamBranchName = line.substring('# branch.upstream '.length).trim();
1105
const m = /^# branch\.ab \+(\d+) -(\d+)$/.exec(line);
1106
if (m) {