MCPcopy Create free account
hub / github.com/git/git / trailer_set_if_exists

Function trailer_set_if_exists

trailer.c:406–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404}
405
406int trailer_set_if_exists(enum trailer_if_exists *item, const char *value)
407{
408 if (!value)
409 *item = EXISTS_DEFAULT;
410 else if (!strcasecmp("addIfDifferent", value))
411 *item = EXISTS_ADD_IF_DIFFERENT;
412 else if (!strcasecmp("addIfDifferentNeighbor", value))
413 *item = EXISTS_ADD_IF_DIFFERENT_NEIGHBOR;
414 else if (!strcasecmp("add", value))
415 *item = EXISTS_ADD;
416 else if (!strcasecmp("replace", value))
417 *item = EXISTS_REPLACE;
418 else if (!strcasecmp("doNothing", value))
419 *item = EXISTS_DO_NOTHING;
420 else
421 return -1;
422 return 0;
423}
424
425int trailer_set_if_missing(enum trailer_if_missing *item, const char *value)
426{

Callers 3

git_trailer_configFunction · 0.85
option_parse_if_existsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected