diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-05 22:00:18 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-05 22:00:18 +0300 |
commit | 51f319c08f55beb12cf1e1d4db9299434b9b1496 (patch) | |
tree | 5afdb5b5e3159399b5db518f923bf46dcfe4d1ae /builtin | |
parent | 7c997bcbf68738f2b0cb1a94228ace211c9ba075 (diff) | |
parent | 7886cfa08054046a7a82726be4b8c109b2ba1344 (diff) |
Merge branch 'ps/bundle-verify-arg' into maint
"git bundle verify" did not diagnose extra parameters on the
command line.
* ps/bundle-verify-arg:
bundle: verify arguments more strictly
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/bundle.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c index 92a8a6026a..4883a435a9 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -42,6 +42,10 @@ int cmd_bundle(int argc, const char **argv, const char *prefix) if (!strcmp(cmd, "verify")) { close(bundle_fd); + if (argc != 1) { + usage(builtin_bundle_usage); + return 1; + } if (verify_bundle(&header, 1)) return 1; 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); } if (!strcmp(cmd, "create")) { + if (argc < 2) { + usage(builtin_bundle_usage); + return 1; + } if (!startup_info->have_repository) die(_("Need a repository to create a bundle.")); return !!create_bundle(&header, bundle_file, argc, argv); |