MCPcopy Index your code
hub / github.com/git/git / apply_filter

Function apply_filter

convert.c:996–1022  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994} *user_convert, **user_convert_tail;
995
996static 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
1024static int read_convert_config(const char *var, const char *value,
1025 const struct config_context *ctx UNUSED,

Callers 4

convert_to_gitFunction · 0.85
convert_to_git_filter_fdFunction · 0.85

Calls 2

apply_single_file_filterFunction · 0.85
apply_multi_file_filterFunction · 0.85

Tested by

no test coverage detected