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

Function cmd_bundle_verify

builtin/bundle.c:127–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static int cmd_bundle_verify(int argc, const char **argv, const char *prefix,
128 struct repository *repo UNUSED) {
129 struct bundle_header header = BUNDLE_HEADER_INIT;
130 int bundle_fd = -1;
131 int quiet = 0;
132 int ret;
133 struct option options[] = {
134 OPT_BOOL('q', "quiet", &quiet,
135 N_("do not show bundle details")),
136 OPT_END()
137 };
138 char *bundle_file;
139 const char *name;
140
141 argc = parse_options_cmd_bundle(argc, argv, prefix,
142 builtin_bundle_verify_usage, options, &bundle_file);
143 /* bundle internals use argv[1] as further parameters */
144
145 if (!startup_info->have_repository) {
146 ret = error(_("need a repository to verify a bundle"));
147 goto cleanup;
148 }
149
150 if ((bundle_fd = open_bundle(bundle_file, &header, &name)) < 0) {
151 ret = 1;
152 goto cleanup;
153 }
154 close(bundle_fd);
155 if (verify_bundle(the_repository, &header,
156 quiet ? VERIFY_BUNDLE_QUIET : VERIFY_BUNDLE_VERBOSE)) {
157 ret = 1;
158 goto cleanup;
159 }
160
161 fprintf(stderr, _("%s is okay\n"), name);
162 ret = 0;
163cleanup:
164 free(bundle_file);
165 bundle_header_release(&header);
166 return ret;
167}
168
169static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix,
170 struct repository *repo UNUSED) {

Callers

nothing calls this directly

Calls 5

parse_options_cmd_bundleFunction · 0.85
errorFunction · 0.85
open_bundleFunction · 0.85
verify_bundleFunction · 0.85
bundle_header_releaseFunction · 0.85

Tested by

no test coverage detected