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

Function cmd_bundle_unbundle

builtin/bundle.c:195–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix,
196 struct repository *repo UNUSED) {
197 struct bundle_header header = BUNDLE_HEADER_INIT;
198 int bundle_fd = -1;
199 int ret;
200 int progress = isatty(2);
201
202 struct option options[] = {
203 OPT_BOOL(0, "progress", &progress,
204 N_("show progress meter")),
205 OPT_END()
206 };
207 char *bundle_file;
208 struct strvec extra_index_pack_args = STRVEC_INIT;
209
210 argc = parse_options_cmd_bundle(argc, argv, prefix,
211 builtin_bundle_unbundle_usage, options, &bundle_file);
212 /* bundle internals use argv[1] as further parameters */
213
214 if (!startup_info->have_repository)
215 die(_("Need a repository to unbundle."));
216
217 if ((bundle_fd = open_bundle(bundle_file, &header, NULL)) < 0) {
218 ret = 1;
219 goto cleanup;
220 }
221 if (progress)
222 strvec_pushl(&extra_index_pack_args, "-v", "--progress-title",
223 _("Unbundling objects"), NULL);
224 ret = !!unbundle(the_repository, &header, bundle_fd,
225 &extra_index_pack_args, NULL) ||
226 list_bundle_refs(&header, argc, argv);
227 bundle_header_release(&header);
228
229cleanup:
230 strvec_clear(&extra_index_pack_args);
231 free(bundle_file);
232 return ret;
233}
234
235int cmd_bundle(int argc,
236 const char **argv,

Callers

nothing calls this directly

Calls 8

parse_options_cmd_bundleFunction · 0.85
open_bundleFunction · 0.85
strvec_pushlFunction · 0.85
unbundleFunction · 0.85
list_bundle_refsFunction · 0.85
bundle_header_releaseFunction · 0.85
strvec_clearFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected