Diff options
Diffstat (limited to 'source/shared.h')
| -rw-r--r-- | source/shared.h | 24 |
1 file changed, 22 insertions, 2 deletions
diff --git a/source/shared.h b/source/shared.h index f182962..b24c690 100644 --- a/source/shared.h +++ b/source/shared.h @@ -25,8 +25,9 @@ extern struct cgit_repo *cgit_get_repoinfo(const char *url); /* * A diff format callback that hands each filepair to the filepair_fn data - * points at. ISO C has no conversion between a function pointer and void *, - * so the function travels by address. + * points at, or only the pair landing on single_follow when that is set. ISO + * C has no conversion between a function pointer and void *, so the function + * travels by address. */ extern void cgit_diff_tree_cb(struct diff_queue_struct *q, struct diff_options *options, void *data); @@ -45,6 +46,25 @@ extern int cgit_diff_files(const struct object_id *old_oid, const struct object_ */ extern void cgit_diff_limit_path(struct diff_options *opt, const char *prefix); +/* + * Limit a diff to path and to source, the name it was renamed from, both + * taken literally, with rename detection on so that git pairs the two. + */ +extern void cgit_diff_limit_rename(struct diff_options *opt, const char *path, const char *source); + +/* + * The name path had in the old tree when the change between the two trees + * renamed it, or NULL when path is no renamed file's new name. The result is + * the caller's to free. + */ +extern char *cgit_rename_source(const struct object_id *old_oid, const struct object_id *new_oid, + const char *path); + +/* + * Hand fn each filepair between the two trees, limited to the paths below + * prefix when one is given. A prefix naming a file the old tree lacks still + * comes back as the rename that produced it. + */ 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); |
