| 1449 | } |
| 1450 | |
| 1451 | static int git_status_config(const char *k, const char *v, |
| 1452 | const struct config_context *ctx, void *cb) |
| 1453 | { |
| 1454 | struct wt_status *s = cb; |
| 1455 | const char *slot_name; |
| 1456 | |
| 1457 | if (starts_with(k, "column.")) |
| 1458 | return git_column_config(k, v, "status", &s->colopts); |
| 1459 | if (!strcmp(k, "status.submodulesummary")) { |
| 1460 | int is_bool; |
| 1461 | s->submodule_summary = git_config_bool_or_int(k, v, ctx->kvi, |
| 1462 | &is_bool); |
| 1463 | if (is_bool && s->submodule_summary) |
| 1464 | s->submodule_summary = -1; |
| 1465 | return 0; |
| 1466 | } |
| 1467 | if (!strcmp(k, "status.short")) { |
| 1468 | if (git_config_bool(k, v)) |
| 1469 | status_deferred_config.status_format = STATUS_FORMAT_SHORT; |
| 1470 | else |
| 1471 | status_deferred_config.status_format = STATUS_FORMAT_NONE; |
| 1472 | return 0; |
| 1473 | } |
| 1474 | if (!strcmp(k, "status.branch")) { |
| 1475 | status_deferred_config.show_branch = git_config_bool(k, v); |
| 1476 | return 0; |
| 1477 | } |
| 1478 | if (!strcmp(k, "status.aheadbehind")) { |
| 1479 | status_deferred_config.ahead_behind = git_config_bool(k, v); |
| 1480 | return 0; |
| 1481 | } |
| 1482 | if (!strcmp(k, "status.showstash")) { |
| 1483 | s->show_stash = git_config_bool(k, v); |
| 1484 | return 0; |
| 1485 | } |
| 1486 | if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) { |
| 1487 | s->use_color = git_config_colorbool(k, v); |
| 1488 | return 0; |
| 1489 | } |
| 1490 | if (!strcmp(k, "status.displaycommentprefix")) { |
| 1491 | s->display_comment_prefix = git_config_bool(k, v); |
| 1492 | return 0; |
| 1493 | } |
| 1494 | if (skip_prefix(k, "status.color.", &slot_name) || |
| 1495 | skip_prefix(k, "color.status.", &slot_name)) { |
| 1496 | int slot = parse_status_slot(slot_name); |
| 1497 | if (slot < 0) |
| 1498 | return 0; |
| 1499 | if (!v) |
| 1500 | return config_error_nonbool(k); |
| 1501 | return color_parse(v, s->color_palette[slot]); |
| 1502 | } |
| 1503 | if (!strcmp(k, "status.relativepaths")) { |
| 1504 | s->relative_paths = git_config_bool(k, v); |
| 1505 | return 0; |
| 1506 | } |
| 1507 | if (!strcmp(k, "status.showuntrackedfiles")) { |
| 1508 | enum untracked_status_type u; |
no test coverage detected