From 54443bbfc38d0252b31c821fea77320fcf0fe277 Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Sun, 9 Jun 2024 09:39:08 +0200 Subject: userdiff: add and use struct external_diff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- userdiff.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'userdiff.h') diff --git a/userdiff.h b/userdiff.h index cc8e5abfef..2d59a8fc56 100644 --- a/userdiff.h +++ b/userdiff.h @@ -11,9 +11,13 @@ struct userdiff_funcname { int cflags; }; +struct external_diff { + char *cmd; +}; + struct userdiff_driver { const char *name; - char *external; + struct external_diff external; char *algorithm; int binary; struct userdiff_funcname funcname; -- cgit v1.2.3