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

Function cmd_bundle_create

builtin/bundle.c:70–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static int cmd_bundle_create(int argc, const char **argv, const char *prefix,
71 struct repository *repo UNUSED) {
72 struct strvec pack_opts = STRVEC_INIT;
73 int version = -1;
74 int ret;
75 struct option options[] = {
76 OPT_PASSTHRU_ARGV('q', "quiet", &pack_opts, NULL,
77 N_("do not show progress meter"),
78 PARSE_OPT_NOARG),
79 OPT_PASSTHRU_ARGV(0, "progress", &pack_opts, NULL,
80 N_("show progress meter"),
81 PARSE_OPT_NOARG),
82 OPT_PASSTHRU_ARGV(0, "all-progress", &pack_opts, NULL,
83 N_("historical; same as --progress"),
84 PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
85 OPT_PASSTHRU_ARGV(0, "all-progress-implied", &pack_opts, NULL,
86 N_("historical; does nothing"),
87 PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
88 OPT_INTEGER(0, "version", &version,
89 N_("specify bundle format version")),
90 OPT_END()
91 };
92 char *bundle_file;
93
94 if (isatty(STDERR_FILENO))
95 strvec_push(&pack_opts, "--progress");
96 strvec_push(&pack_opts, "--all-progress-implied");
97
98 argc = parse_options_cmd_bundle(argc, argv, prefix,
99 builtin_bundle_create_usage, options, &bundle_file);
100 /* bundle internals use argv[1] as further parameters */
101
102 if (!startup_info->have_repository)
103 die(_("Need a repository to create a bundle."));
104 ret = !!create_bundle(the_repository, bundle_file, argc, argv, &pack_opts, version);
105 strvec_clear(&pack_opts);
106 free(bundle_file);
107 return ret;
108}
109
110/*
111 * Similar to read_bundle_header(), but handle "-" as stdin.

Callers

nothing calls this directly

Calls 5

strvec_pushFunction · 0.85
parse_options_cmd_bundleFunction · 0.85
create_bundleFunction · 0.85
strvec_clearFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected