Skip to content

Commit 44fa796

Browse files
committed
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
2 parents 39fa791 + 7886cfa commit 44fa796

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

builtin/bundle.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
4242

4343
if (!strcmp(cmd, "verify")) {
4444
close(bundle_fd);
45+
if (argc != 1) {
46+
usage(builtin_bundle_usage);
47+
return 1;
48+
}
4549
if (verify_bundle(&header, 1))
4650
return 1;
4751
fprintf(stderr, _("%s is okay\n"), bundle_file);
@@ -52,6 +56,10 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
5256
return !!list_bundle_refs(&header, argc, argv);
5357
}
5458
if (!strcmp(cmd, "create")) {
59+
if (argc < 2) {
60+
usage(builtin_bundle_usage);
61+
return 1;
62+
}
5563
if (!startup_info->have_repository)
5664
die(_("Need a repository to create a bundle."));
5765
return !!create_bundle(&header, bundle_file, argc, argv);

0 commit comments

Comments
 (0)