Skip to content

Commit a56de9e

Browse files
authored
Create Pull Request Suggestions silently fails when the suggestion is on the first line (#6627)
Fixes #6603
1 parent 7a6e85f commit a56de9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/common/diffHunk.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ export function splitIntoSmallerHunks(hunk: DiffHunk): DiffHunk[] {
239239
}
240240
addLineToHunk(nextHunk, line);
241241
}
242-
} else if (currentHunk) {
242+
} else if (currentHunk || ((hunk.oldLineNumber === 1) && ((line.type === DiffChangeType.Delete) || (line.type === DiffChangeType.Add)))) {
243+
if (!currentHunk) {
244+
currentHunk = newHunk(line);
245+
}
243246
if (hunkHasSandwichedChanges(currentHunk)) {
244247
splitHunks.push(currentHunk);
245248
currentHunk = nextHunk!;

0 commit comments

Comments
 (0)