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

Function quote_two

diff.c:540–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540static char *quote_two(const char *one, const char *two)
541{
542 int need_one = quote_c_style(one, NULL, NULL, CQUOTE_NODQ);
543 int need_two = quote_c_style(two, NULL, NULL, CQUOTE_NODQ);
544 struct strbuf res = STRBUF_INIT;
545
546 if (need_one + need_two) {
547 strbuf_addch(&res, '"');
548 quote_c_style(one, &res, NULL, CQUOTE_NODQ);
549 quote_c_style(two, &res, NULL, CQUOTE_NODQ);
550 strbuf_addch(&res, '"');
551 } else {
552 strbuf_addstr(&res, one);
553 strbuf_addstr(&res, two);
554 }
555 return strbuf_detach(&res, NULL);
556}
557
558static const struct external_diff *external_diff(void)
559{

Callers 1

builtin_diffFunction · 0.85

Calls 4

quote_c_styleFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_detachFunction · 0.85

Tested by

no test coverage detected