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

Function add_checkout_path_options

builtin/checkout.c:1808–1830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1806}
1807
1808static struct option *add_checkout_path_options(struct checkout_opts *opts,
1809 struct option *prevopts)
1810{
1811 struct option options[] = {
1812 OPT_SET_INT_F('2', "ours", &opts->writeout_stage,
1813 N_("checkout our version for unmerged files"),
1814 2, PARSE_OPT_NONEG),
1815 OPT_SET_INT_F('3', "theirs", &opts->writeout_stage,
1816 N_("checkout their version for unmerged files"),
1817 3, PARSE_OPT_NONEG),
1818 OPT_BOOL('p', "patch", &opts->patch_mode, N_("select hunks interactively")),
1819 OPT_DIFF_UNIFIED(&opts->patch_context),
1820 OPT_DIFF_INTERHUNK_CONTEXT(&opts->patch_interhunk_context),
1821 OPT_BOOL(0, "ignore-skip-worktree-bits", &opts->ignore_skipworktree,
1822 N_("do not limit pathspecs to sparse entries only")),
1823 OPT_PATHSPEC_FROM_FILE(&opts->pathspec_from_file),
1824 OPT_PATHSPEC_FILE_NUL(&opts->pathspec_file_nul),
1825 OPT_END()
1826 };
1827 struct option *newopts = parse_options_concat(prevopts, options);
1828 free(prevopts);
1829 return newopts;
1830}
1831
1832/* create-branch option (either b or c) */
1833static char cb_option = 'b';

Callers 2

cmd_checkoutFunction · 0.85
cmd_restoreFunction · 0.85

Calls 1

parse_options_concatFunction · 0.85

Tested by

no test coverage detected