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

Function expand_string_arg

pretty.c:1267–1286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1265}
1266
1267static struct strbuf *expand_string_arg(struct strbuf *sb,
1268 const char *argval, size_t arglen)
1269{
1270 char *fmt = xstrndup(argval, arglen);
1271 const char *format = fmt;
1272
1273 strbuf_reset(sb);
1274 while (strbuf_expand_step(sb, &format)) {
1275 size_t len;
1276
1277 if (skip_prefix(format, "%", &format))
1278 strbuf_addch(sb, '%');
1279 else if ((len = strbuf_expand_literal(sb, format)))
1280 format += len;
1281 else
1282 strbuf_addch(sb, '%');
1283 }
1284 free(fmt);
1285 return sb;
1286}
1287
1288int format_set_trailers_options(struct process_trailer_options *opts,
1289 struct string_list *filter_list,

Callers 2

parse_decoration_optionFunction · 0.85

Calls 4

xstrndupFunction · 0.85
strbuf_expand_stepFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_expand_literalFunction · 0.85

Tested by

no test coverage detected