| 994 | } *user_convert, **user_convert_tail; |
| 995 | |
| 996 | static int apply_filter(const char *path, const char *src, size_t len, |
| 997 | int fd, struct strbuf *dst, struct convert_driver *drv, |
| 998 | const unsigned int wanted_capability, |
| 999 | const struct checkout_metadata *meta, |
| 1000 | struct delayed_checkout *dco) |
| 1001 | { |
| 1002 | const char *cmd = NULL; |
| 1003 | |
| 1004 | if (!drv) |
| 1005 | return 0; |
| 1006 | |
| 1007 | if (!dst) |
| 1008 | return 1; |
| 1009 | |
| 1010 | if ((wanted_capability & CAP_CLEAN) && !drv->process && drv->clean) |
| 1011 | cmd = drv->clean; |
| 1012 | else if ((wanted_capability & CAP_SMUDGE) && !drv->process && drv->smudge) |
| 1013 | cmd = drv->smudge; |
| 1014 | |
| 1015 | if (cmd && *cmd) |
| 1016 | return apply_single_file_filter(path, src, len, fd, dst, cmd); |
| 1017 | else if (drv->process && *drv->process) |
| 1018 | return apply_multi_file_filter(path, src, len, fd, dst, |
| 1019 | drv->process, wanted_capability, meta, dco); |
| 1020 | |
| 1021 | return 0; |
| 1022 | } |
| 1023 | |
| 1024 | static int read_convert_config(const char *var, const char *value, |
| 1025 | const struct config_context *ctx UNUSED, |
no test coverage detected