diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-04-12 19:15:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-11 05:47:31 +0200 |
commit | 22233d43eb5479d1076e034eb5cdba973fa2b02a (patch) | |
tree | 96179bcade36e6fbc6745c44d153ee1f3da50971 /builtin/merge-tree.c | |
parent | pickaxe -G: don't special-case create/delete (diff) | |
download | git-22233d43eb5479d1076e034eb5cdba973fa2b02a.tar.xz git-22233d43eb5479d1076e034eb5cdba973fa2b02a.zip |
xdiff users: use designated initializers for out_line
Amend the code added in 611e42a5980 (xdiff: provide a separate emit
callback for hunks, 2018-11-02) to be more readable by using
designated initializers.
This changes "priv" in rerere.c to be initialized to NULL as we did in
merge-tree.c. That's not needed as we'll only use it if the callback
is defined, but being consistent here is better and less verbose.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-tree.c')
-rw-r--r-- | builtin/merge-tree.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index de8520778d..5dc94d6f88 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -107,15 +107,12 @@ static void show_diff(struct merge_list *entry) mmfile_t src, dst; xpparam_t xpp; xdemitconf_t xecfg; - xdemitcb_t ecb; + xdemitcb_t ecb = { .out_line = show_outf }; memset(&xpp, 0, sizeof(xpp)); xpp.flags = 0; memset(&xecfg, 0, sizeof(xecfg)); xecfg.ctxlen = 3; - ecb.out_hunk = NULL; - ecb.out_line = show_outf; - ecb.priv = NULL; src.ptr = origin(entry, &size); if (!src.ptr) |