Merge branch 'ps/bundle-verify-arg'
"git bundle verify" did not diagnose extra parameters on the command line. * ps/bundle-verify-arg: bundle: verify arguments more strictly
This commit is contained in:
@ -42,6 +42,10 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
if (!strcmp(cmd, "verify")) {
|
if (!strcmp(cmd, "verify")) {
|
||||||
close(bundle_fd);
|
close(bundle_fd);
|
||||||
|
if (argc != 1) {
|
||||||
|
usage(builtin_bundle_usage);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (verify_bundle(&header, 1))
|
if (verify_bundle(&header, 1))
|
||||||
return 1;
|
return 1;
|
||||||
fprintf(stderr, _("%s is okay\n"), bundle_file);
|
fprintf(stderr, _("%s is okay\n"), bundle_file);
|
||||||
@ -52,6 +56,10 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
|
|||||||
return !!list_bundle_refs(&header, argc, argv);
|
return !!list_bundle_refs(&header, argc, argv);
|
||||||
}
|
}
|
||||||
if (!strcmp(cmd, "create")) {
|
if (!strcmp(cmd, "create")) {
|
||||||
|
if (argc < 2) {
|
||||||
|
usage(builtin_bundle_usage);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (!startup_info->have_repository)
|
if (!startup_info->have_repository)
|
||||||
die(_("Need a repository to create a bundle."));
|
die(_("Need a repository to create a bundle."));
|
||||||
return !!create_bundle(&header, bundle_file, argc, argv);
|
return !!create_bundle(&header, bundle_file, argc, argv);
|
||||||
|
Reference in New Issue
Block a user