aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/git.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/api/git.js b/api/git.js
index 5c6f0d9..dad7cc6 100644
--- a/api/git.js
+++ b/api/git.js
@@ -157,9 +157,10 @@ async function getCommit(base_dir, repo_name, commit_oid)
const patch_end = (patch_header_data[0][patch_index + 1] !== undefined) ? patch_header_data[0][patch_index + 1] : all_patches.length - 1;
const patch_content = all_patches.slice(patch_start, patch_end);
- console.log(patch_content.length);
- if(patch_content.length > 5000) {
- console.log("Collapsed!");
+ const line_lengths = patch_content.map((line) => line.length).reduce((acc, length) => acc + length);
+
+ if(patch_content.length > 5000 || line_lengths > 5000) {
+ console.log("Too large!");
arr.push({
from: patch.oldFile().path(),