Skip to content

Commit 59642df

Browse files
Update src/proxy/processors/push-action/parsePush.ts
Co-authored-by: j-k <[email protected]>
1 parent a83f566 commit 59642df

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/proxy/processors/push-action/parsePush.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,14 @@ const getParsedData = (headerLines: string[]) => {
131131
} = { parents: [] };
132132

133133
for (const line of headerLines) {
134-
const spaceIndex = line.indexOf(' ');
135-
if (spaceIndex === -1) continue;
134+
const firstSpaceIndex = line.indexOf(' ');
135+
if (firstSpaceIndex === -1) {
136+
// No spaces
137+
continue;
138+
}
136139

137-
const key = line.substring(0, spaceIndex);
138-
const value = line.substring(spaceIndex + 1);
140+
const key = line.substring(0, firstSpaceIndex);
141+
const value = line.substring(firstSpaceIndex + 1);
139142

140143
switch (key) {
141144
case 'tree':

0 commit comments

Comments
 (0)