Skip to content

Commit 431e21e

Browse files
committed
Make sure there is no space after the signature
1 parent 1b2848d commit 431e21e

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

web/src/lib/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function binaryFileDummyDetails(fromFile: string, toFile: string, status:
9696
return makeTextDetails(fromFile, toFile, status, fakeContent);
9797
}
9898

99-
const fileRegex = /diff --git a\/(\S+) b\/(\S+)\r?\n(?:.+\r?\n)*?(?=-- *\r?\n|diff --git|$)/g;
99+
const fileRegex = /diff --git a\/(\S+) b\/(\S+)\r?\n(?:.+\r?\n)*?(?=-- \r?\n|diff --git|$)/g;
100100

101101
function parseHeader(
102102
patch: string,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From f6ec5d6950dc0e09a72148022353bfd9c7d63cba Mon Sep 17 00:00:00 2001
2+
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
3+
Date: Sun, 29 Jun 2025 19:04:34 -0400
4+
Subject: [PATCH] test
5+
6+
---
7+
test | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/test b/test
11+
index 3636ae5..3aa784f 100644
12+
--- a/test
13+
+++ b/test
14+
@@ -5,6 +5,6 @@ e
15+
16+
345
17+
123
18+
--
19+
+
20+
e
21+
abc
22+
\ No newline at end of file
23+
--
24+
2.43.0.windows.1
25+

web/src/test/util.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ test("Yield 2 patches from a patch file with signature", () => {
88
expect(splitMultiFilePatch(patch).length).toBe(2);
99
});
1010

11+
test("Yield 1 patches from a patch file with signature and double -- in the diff", () => {
12+
const patch = loadPatch("patch-with-multiple-minus-diff-with-signature.patch");
13+
expect(splitMultiFilePatch(patch).length).toBe(1);
14+
});
15+
1116
test("Yield 2 patches from a patch file without signature", () => {
1217
const patch = loadPatch("patch-without-signature.patch");
1318
expect(splitMultiFilePatch(patch).length).toBe(2);

0 commit comments

Comments
 (0)