From 22773596fe2e472bb9a41894c7b09b656890a056 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 1 Oct 2026 16:20:14 -1000 Subject: Limit rawdiff to the requested path The diff and patch pages honour the path in the url, which the parameter table documents for every page, but rawdiff never handed it to git and answered with the whole diff. --- source/shared.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/shared.h') diff --git a/source/shared.h b/source/shared.h index 9e39389..d61c1f1 100644 --- a/source/shared.h +++ b/source/shared.h @@ -60,6 +60,11 @@ extern int cgit_diff_files(const struct object_id *old_oid, const struct object_ unsigned long *old_size, unsigned long *new_size, int *binary, int context, int ignorews, linediff_fn fn); +/* + * Limit a diff to the paths below prefix, which is taken literally. + */ +extern void cgit_diff_limit_path(struct diff_options *opt, const char *prefix); + extern void cgit_diff_tree(const struct object_id *old_oid, const struct object_id *new_oid, filepair_fn fn, const char *prefix, int ignorews); extern void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix); -- cgit v2.8.0