MCPcopy Index your code
hub / github.com/git/git / cmd_status

Function cmd_status

builtin/commit.c:1537–1667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535}
1536
1537int cmd_status(int argc,
1538const char **argv,
1539const char *prefix,
1540struct repository *repo UNUSED)
1541{
1542 static int no_renames = -1;
1543 static const char *rename_score_arg = (const char *)-1;
1544 static struct wt_status s;
1545 unsigned int progress_flag = 0;
1546 int fd;
1547 struct object_id oid;
1548 static struct option builtin_status_options[] = {
1549 OPT__VERBOSE(&verbose, N_("be verbose")),
1550 OPT_SET_INT('s', "short", &status_format,
1551 N_("show status concisely"), STATUS_FORMAT_SHORT),
1552 OPT_BOOL('b', "branch", &s.show_branch,
1553 N_("show branch information")),
1554 OPT_BOOL(0, "show-stash", &s.show_stash,
1555 N_("show stash information")),
1556 OPT_BOOL(0, "ahead-behind", &s.ahead_behind_flags,
1557 N_("compute full ahead/behind values")),
1558 OPT_CALLBACK_F(0, "porcelain", &status_format,
1559 N_("version"), N_("machine-readable output"),
1560 PARSE_OPT_OPTARG, opt_parse_porcelain),
1561 OPT_SET_INT(0, "long", &status_format,
1562 N_("show status in long format (default)"),
1563 STATUS_FORMAT_LONG),
1564 OPT_BOOL('z', "null", &s.null_termination,
1565 N_("terminate entries with NUL")),
1566 {
1567 .type = OPTION_STRING,
1568 .short_name = 'u',
1569 .long_name = "untracked-files",
1570 .value = &untracked_files_arg,
1571 .argh = N_("mode"),
1572 .help = N_("show untracked files, optional modes: all, normal, no. (Default: all)"),
1573 .flags = PARSE_OPT_OPTARG,
1574 .defval = (intptr_t)"all",
1575 },
1576 {
1577 .type = OPTION_STRING,
1578 .long_name = "ignored",
1579 .value = &ignored_arg,
1580 .argh = N_("mode"),
1581 .help = N_("show ignored files, optional modes: traditional, matching, no. (Default: traditional)"),
1582 .flags = PARSE_OPT_OPTARG,
1583 .defval = (intptr_t)"traditional",
1584 },
1585 {
1586 .type = OPTION_STRING,
1587 .long_name = "ignore-submodules",
1588 .value = &ignore_submodule_arg,
1589 .argh = N_("when"),
1590 .help = N_("ignore changes to submodules, optional when: all, dirty, untracked. (Default: all)"),
1591 .flags = PARSE_OPT_OPTARG,
1592 .defval = (intptr_t)"all",
1593 },
1594 OPT_COLUMN(0, "column", &s.colopts, N_("list untracked files in columns")),

Callers

nothing calls this directly

Calls 15

prepare_repo_settingsFunction · 0.85
status_init_configFunction · 0.85
parse_optionsFunction · 0.85
finalize_coloptsFunction · 0.85
finalize_deferred_configFunction · 0.85
handle_ignored_argFunction · 0.85
parse_pathspecFunction · 0.85
repo_read_indexFunction · 0.85
refresh_indexFunction · 0.85
use_optional_locksFunction · 0.85

Tested by

no test coverage detected