From be97de96b684221c38cb1004ec2669ad73cfc518 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 18 Jan 2024 00:35:31 +0100 Subject: [PATCH] fix: avoid too long diffs in cli --- cli/types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/types.ts b/cli/types.ts index c6eeb5502f..b40b34d001 100644 --- a/cli/types.ts +++ b/cli/types.ts @@ -64,6 +64,10 @@ export function isSuperset( export function showDiff(local: string, remote: string) { let finalString = ""; + if (local?.length > 20000 || remote?.length > 20000) { + log.info("Diff too large to display"); + return; + } for (const part of Diff.diffLines(local, remote)) { if (part.removed) { // print red if removed without newline