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

Function cmd_pull

builtin/pull.c:856–1189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856int cmd_pull(int argc,
857 const char **argv,
858 const char *prefix,
859 struct repository *repository UNUSED)
860{
861 const char *repo, **refspecs;
862 struct oid_array merge_heads = OID_ARRAY_INIT;
863 struct object_id orig_head, curr_head;
864 struct object_id rebase_fork_point;
865 int rebase_unspecified = 0;
866 int can_ff;
867 int divergent;
868 int ret;
869 static struct option pull_options[] = {
870 /* Shared options */
871 OPT__VERBOSITY(&opt_verbosity),
872 OPT_PASSTHRU(0, "progress", &opt_progress, NULL,
873 N_("force progress reporting"),
874 PARSE_OPT_NOARG),
875 OPT_CALLBACK_F(0, "recurse-submodules",
876 &recurse_submodules_cli, N_("on-demand"),
877 N_("control for recursive fetching of submodules"),
878 PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules),
879
880 /* Options passed to git-merge or git-rebase */
881 OPT_GROUP(N_("Options related to merging")),
882 OPT_CALLBACK_F('r', "rebase", &opt_rebase,
883 "(false|true|merges|interactive)",
884 N_("incorporate changes by rebasing rather than merging"),
885 PARSE_OPT_OPTARG, parse_opt_rebase),
886 OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
887 N_("do not show a diffstat at the end of the merge"),
888 PARSE_OPT_NOARG | PARSE_OPT_NONEG),
889 OPT_PASSTHRU(0, "stat", &opt_diffstat, NULL,
890 N_("show a diffstat at the end of the merge"),
891 PARSE_OPT_NOARG),
892 OPT_PASSTHRU(0, "summary", &opt_diffstat, NULL,
893 N_("(synonym to --stat)"),
894 PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
895 OPT_PASSTHRU(0, "compact-summary", &opt_diffstat, NULL,
896 N_("show a compact-summary at the end of the merge"),
897 PARSE_OPT_NOARG),
898 OPT_PASSTHRU(0, "log", &opt_log, N_("n"),
899 N_("add (at most <n>) entries from shortlog to merge commit message"),
900 PARSE_OPT_OPTARG),
901 OPT_PASSTHRU(0, "signoff", &opt_signoff, NULL,
902 N_("add a Signed-off-by trailer"),
903 PARSE_OPT_OPTARG),
904 OPT_PASSTHRU(0, "squash", &opt_squash, NULL,
905 N_("create a single commit instead of doing a merge"),
906 PARSE_OPT_NOARG),
907 OPT_PASSTHRU(0, "commit", &opt_commit, NULL,
908 N_("perform a commit if the merge succeeds (default)"),
909 PARSE_OPT_NOARG),
910 OPT_PASSTHRU(0, "edit", &opt_edit, NULL,
911 N_("edit message before committing"),
912 PARSE_OPT_NOARG),
913 OPT_CLEANUP(&cleanup_arg),

Callers

nothing calls this directly

Calls 15

prepare_repo_settingsFunction · 0.85
parse_optionsFunction · 0.85
get_cleanup_modeFunction · 0.85
parse_repo_refspecsFunction · 0.85
xstrdup_or_nullFunction · 0.85
config_get_ffFunction · 0.85
xstrdupFunction · 0.85
config_get_rebaseFunction · 0.85
repo_read_index_unmergedFunction · 0.85
die_resolve_conflictFunction · 0.85
file_existsFunction · 0.85
die_conclude_mergeFunction · 0.85

Tested by

no test coverage detected