diff options
| author | René Scharfe <l.s.r@web.de> | 2024-06-09 09:39:08 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-10 09:19:20 -0700 |
| commit | 54443bbfc38d0252b31c821fea77320fcf0fe277 (patch) | |
| tree | 953edd762a745292d36128552d2cb253e34b70c5 /userdiff.h | |
| parent | 33be6cf51acf74e623fb3c4e287f7aebbedf5c09 (diff) | |
| download | git-54443bbfc38d0252b31c821fea77320fcf0fe277.tar.gz | |
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>
Diffstat (limited to 'userdiff.h')
| -rw-r--r-- | userdiff.h | 6 |
1 files changed, 5 insertions, 1 deletions
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; |
