| 464 | } |
| 465 | |
| 466 | void git_config_push_parameter(const char *text) |
| 467 | { |
| 468 | const char *value; |
| 469 | |
| 470 | /* |
| 471 | * When we see: |
| 472 | * |
| 473 | * section.subsection=with=equals.key=value |
| 474 | * |
| 475 | * we cannot tell if it means: |
| 476 | * |
| 477 | * [section "subsection=with=equals"] |
| 478 | * key = value |
| 479 | * |
| 480 | * or: |
| 481 | * |
| 482 | * [section] |
| 483 | * subsection = with=equals.key=value |
| 484 | * |
| 485 | * We parse left-to-right for the first "=", meaning we'll prefer to |
| 486 | * keep the value intact over the subsection. This is historical, but |
| 487 | * also sensible since values are more likely to contain odd or |
| 488 | * untrusted input than a section name. |
| 489 | * |
| 490 | * A missing equals is explicitly allowed (as a bool-only entry). |
| 491 | */ |
| 492 | value = strchr(text, '='); |
| 493 | if (value) { |
| 494 | char *key = xmemdupz(text, value - text); |
| 495 | git_config_push_split_parameter(key, value + 1); |
| 496 | free(key); |
| 497 | } else { |
| 498 | git_config_push_split_parameter(text, NULL); |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | void git_config_push_env(const char *spec) |
| 503 | { |
no test coverage detected