diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-10-10 23:22:29 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-10-10 23:22:30 +0200 |
commit | 3eb4cc451ed97123ff76e183a5be8a7dc164d1f6 (patch) | |
tree | e461fea00a0f4780a41b9baa13de7fd056f644f2 /diff-lib.c | |
parent | Merge branch 'ps/leakfixes-part-8' (diff) | |
parent | diff: store graph prefix buf in git_graph struct (diff) | |
download | git-3eb4cc451ed97123ff76e183a5be8a7dc164d1f6.tar.xz git-3eb4cc451ed97123ff76e183a5be8a7dc164d1f6.zip |
Merge branch 'jk/output-prefix-cleanup'
Code clean-up.
* jk/output-prefix-cleanup:
diff: store graph prefix buf in git_graph struct
diff: return line_prefix directly when possible
diff: return const char from output_prefix callback
diff: drop line_prefix_length field
line-log: use diff_line_prefix() instead of custom helper
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c index a680768ee7..6b14b95962 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -701,7 +701,7 @@ int index_differs_from(struct repository *r, return (has_changes != 0); } -static struct strbuf *idiff_prefix_cb(struct diff_options *opt UNUSED, void *data) +static const char *idiff_prefix_cb(struct diff_options *opt UNUSED, void *data) { return data; } @@ -716,7 +716,7 @@ void show_interdiff(const struct object_id *oid1, const struct object_id *oid2, opts.output_format = DIFF_FORMAT_PATCH; opts.output_prefix = idiff_prefix_cb; strbuf_addchars(&prefix, ' ', indent); - opts.output_prefix_data = &prefix; + opts.output_prefix_data = prefix.buf; diff_setup_done(&opts); diff_tree_oid(oid1, oid2, "", &opts); |