| 390 | } |
| 391 | |
| 392 | static 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 | |
| 409 | void credential_write(const struct credential *c, FILE *fp, |
| 410 | enum credential_op_type op_type) |
no test coverage detected