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

Function credential_write_item

credential.c:392–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static void credential_write_item(const struct credential *c,
393 FILE *fp, const char *key, const char *value,
394 int required)
395{
396 if (!value && required)
397 BUG("credential value for %s is missing", key);
398 if (!value)
399 return;
400 if (strchr(value, '\n'))
401 die("credential value for %s contains newline", key);
402 if (c->protect_protocol && strchr(value, '\r'))
403 die("credential value for %s contains carriage return\n"
404 "If this is intended, set `credential.protectProtocol=false`",
405 key);
406 fprintf(fp, "%s=%s\n", key, value);
407}
408
409void credential_write(const struct credential *c, FILE *fp,
410 enum credential_op_type op_type)

Callers 1

credential_writeFunction · 0.70

Calls 1

dieFunction · 0.70

Tested by

no test coverage detected