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

Function run_textconv

diff.c:7758–7791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7756}
7757
7758static char *run_textconv(struct repository *r,
7759 const char *pgm,
7760 struct diff_filespec *spec,
7761 size_t *outsize)
7762{
7763 struct diff_tempfile *temp;
7764 struct child_process child = CHILD_PROCESS_INIT;
7765 struct strbuf buf = STRBUF_INIT;
7766 int err = 0;
7767
7768 temp = prepare_temp_file(r, spec);
7769 strvec_push(&child.args, pgm);
7770 strvec_push(&child.args, temp->name);
7771
7772 child.use_shell = 1;
7773 child.out = -1;
7774 if (start_command(&child)) {
7775 remove_tempfile();
7776 return NULL;
7777 }
7778
7779 if (strbuf_read(&buf, child.out, 0) < 0)
7780 err = error("error reading from textconv command '%s'", pgm);
7781 close(child.out);
7782
7783 if (finish_command(&child) || err) {
7784 strbuf_release(&buf);
7785 remove_tempfile();
7786 return NULL;
7787 }
7788 remove_tempfile();
7789
7790 return strbuf_detach(&buf, outsize);
7791}
7792
7793size_t fill_textconv(struct repository *r,
7794 struct userdiff_driver *driver,

Callers 1

fill_textconvFunction · 0.85

Calls 9

prepare_temp_fileFunction · 0.85
strvec_pushFunction · 0.85
start_commandFunction · 0.85
remove_tempfileFunction · 0.85
strbuf_readFunction · 0.85
errorFunction · 0.85
finish_commandFunction · 0.85
strbuf_releaseFunction · 0.85
strbuf_detachFunction · 0.85

Tested by

no test coverage detected