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

Function bundle_uri_parse_line

bundle-uri.c:980–1001  ·  view source on GitHub ↗

* General API for {transport,connect}.c etc. */

Source from the content-addressed store, hash-verified

978 * General API for {transport,connect}.c etc.
979 */
980int bundle_uri_parse_line(struct bundle_list *list, const char *line)
981{
982 int result;
983 const char *equals;
984 struct strbuf key = STRBUF_INIT;
985
986 if (!strlen(line))
987 return error(_("bundle-uri: got an empty line"));
988
989 equals = strchr(line, '=');
990
991 if (!equals)
992 return error(_("bundle-uri: line is not of the form 'key=value'"));
993 if (line == equals || !*(equals + 1))
994 return error(_("bundle-uri: line has empty key or value"));
995
996 strbuf_add(&key, line, equals - line);
997 result = bundle_list_update(key.buf, equals + 1, list);
998 strbuf_release(&key);
999
1000 return result;
1001}

Callers 2

get_remote_bundle_uriFunction · 0.85
cmd__bundle_uri_parseFunction · 0.85

Calls 4

errorFunction · 0.85
strbuf_addFunction · 0.85
bundle_list_updateFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by 1

cmd__bundle_uri_parseFunction · 0.68