aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/api/v1
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-06-25 13:21:56 +0200
committerHampusM <hampus@hampusmat.com>2021-06-25 13:21:56 +0200
commitdf341dc9b874f7e7bf99d9c1de3a84c49c4a04a6 (patch)
treefda4bcd92b9119bf4b95d393849d2f643eae8444 /packages/server/src/api/v1
parenta13786d6cc185822f5940582efde2349ef729145 (diff)
Cleaned up the backend
Diffstat (limited to 'packages/server/src/api/v1')
-rw-r--r--packages/server/src/api/v1/repo/log.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/server/src/api/v1/repo/log.ts b/packages/server/src/api/v1/repo/log.ts
index d21cfa8..aa6fa1a 100644
--- a/packages/server/src/api/v1/repo/log.ts
+++ b/packages/server/src/api/v1/repo/log.ts
@@ -20,14 +20,14 @@ async function commitMap(commit: Commit) {
};
}
-async function patchMap(patch: Patch) {
+async function patchMap(patch: Patch, index: number) {
return {
additions: patch.additions,
deletions: patch.deletions,
from: patch.from,
to: patch.to,
- too_large: patch.too_large,
- hunks: await patch.getHunks()
+ too_large: await patch.isTooLarge(index),
+ hunks: await patch.getHunks(index)
};
}
@@ -68,7 +68,7 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do
insertions: stats.insertions,
deletions: stats.deletions,
files_changed: stats.files_changed,
- diff: await Promise.all((await (await commit.diff()).getPatches()).map(patchMap))
+ diff: await Promise.all((await (await commit.diff()).patches()).map(patchMap))
}
});
}