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

Function convert_to_git

convert.c:1431–1463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429}
1430
1431int convert_to_git(struct index_state *istate,
1432 const char *path, const char *src, size_t len,
1433 struct strbuf *dst, int conv_flags)
1434{
1435 int ret = 0;
1436 struct conv_attrs ca;
1437
1438 convert_attrs(istate, &ca, path);
1439
1440 ret |= apply_filter(path, src, len, -1, dst, ca.drv, CAP_CLEAN, NULL, NULL);
1441 if (!ret && ca.drv && ca.drv->required)
1442 die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
1443
1444 if (ret && dst) {
1445 src = dst->buf;
1446 len = dst->len;
1447 }
1448
1449 ret |= encode_to_git(path, src, len, dst, ca.working_tree_encoding, conv_flags);
1450 if (ret && dst) {
1451 src = dst->buf;
1452 len = dst->len;
1453 }
1454
1455 if (!(conv_flags & CONV_EOL_KEEP_CRLF)) {
1456 ret |= crlf_to_git(istate, path, src, len, dst, ca.crlf_action, conv_flags);
1457 if (ret && dst) {
1458 src = dst->buf;
1459 len = dst->len;
1460 }
1461 }
1462 return ret | ident_to_git(src, len, dst, ca.ident);
1463}
1464
1465void convert_to_git_filter_fd(struct index_state *istate,
1466 const char *path, int fd, struct strbuf *dst,

Callers 7

index_memFunction · 0.85
fake_working_tree_commitFunction · 0.85
would_convert_to_gitFunction · 0.85
show_patch_diffFunction · 0.85
renormalize_bufferFunction · 0.85
read_old_dataFunction · 0.85
diff_populate_filespecFunction · 0.85

Calls 6

convert_attrsFunction · 0.85
apply_filterFunction · 0.85
encode_to_gitFunction · 0.85
crlf_to_gitFunction · 0.85
ident_to_gitFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected