Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function binaryFileDummyDetails(fromFile: string, toFile: string, status:
return makeTextDetails(fromFile, toFile, status, fakeContent);
}

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

function parseHeader(
patch: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From f6ec5d6950dc0e09a72148022353bfd9c7d63cba Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Sun, 29 Jun 2025 19:04:34 -0400
Subject: [PATCH] test

---
test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test b/test
index 3636ae5..3aa784f 100644
--- a/test
+++ b/test
@@ -5,6 +5,6 @@ e

345
123
--
+
e
abc
\ No newline at end of file
--
2.43.0.windows.1

5 changes: 5 additions & 0 deletions web/src/test/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ test("Yield 2 patches from a patch file with signature", () => {
expect(splitMultiFilePatch(patch).length).toBe(2);
});

test("Yield 1 patches from a patch file with signature and double -- in the diff", () => {
const patch = loadPatch("patch-with-multiple-minus-diff-with-signature.patch");
expect(splitMultiFilePatch(patch).length).toBe(1);
});

test("Yield 2 patches from a patch file without signature", () => {
const patch = loadPatch("patch-without-signature.patch");
expect(splitMultiFilePatch(patch).length).toBe(2);
Expand Down