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

Function opt_with_value

builtin/rev-parse.c:600–613  ·  view source on GitHub ↗

* Parse "opt" or "opt= ", setting value respectively to either * NULL or the string after "=". */

Source from the content-addressed store, hash-verified

598 * NULL or the string after "=".
599 */
600static int opt_with_value(const char *arg, const char *opt, const char **value)
601{
602 if (skip_prefix(arg, opt, &arg)) {
603 if (!*arg) {
604 *value = NULL;
605 return 1;
606 }
607 if (*arg++ == '=') {
608 *value = arg;
609 return 1;
610 }
611 }
612 return 0;
613}
614
615static void handle_ref_opt(const char *pattern, const char *prefix)
616{

Callers 1

cmd_rev_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected