]> git.ipfire.org Git - thirdparty/git.git/commit
userdiff: add and use struct external_diff
authorRené Scharfe <l.s.r@web.de>
Sun, 9 Jun 2024 07:39:08 +0000 (09:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Jun 2024 16:19:20 +0000 (09:19 -0700)
commit54443bbfc38d0252b31c821fea77320fcf0fe277
tree953edd762a745292d36128552d2cb253e34b70c5
parent33be6cf51acf74e623fb3c4e287f7aebbedf5c09
userdiff: add and use struct external_diff

Wrap the string specifying the external diff command in a new struct to
simplify adding attributes, which the next patch will do.

Make sure external_diff() still returns NULL if neither the environment
variable GIT_EXTERNAL_DIFF nor the configuration option diff.external is
set, to continue allowing its use in a boolean context.

Use a designated initializer for the default builtin userdiff driver to
adjust to the type change of the second struct member.  Spelling out
only the non-zero members improves readability as a nice side-effect.

No functional change intended.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
userdiff.c
userdiff.h