optimization: suppress large diffs
the values are arbitrary, these can be tweaked later if needed.
1 files changed, 8 insertions(+), 0 deletions(-) | |||
---|---|---|---|
M | stagit.c | +8 | -0 |
1@@ -432,6 +432,14 @@ printshowfile(FILE *fp, struct commitinfo *ci)
2 if (!ci->deltas)
3 return;
4
5+ if (ci->filecount > 1000 ||
6+ ci->ndeltas > 1000 ||
7+ ci->addcount > 100000 ||
8+ ci->delcount > 100000) {
9+ fprintf(fp, "(diff is too large, output suppressed)");
10+ return;
11+ }
12+
13 /* diff stat */
14 fputs("<b>Diffstat:</b>\n<table>", fp);
15 for (i = 0; i < ci->ndeltas; i++) {