aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-01-05 15:07:22 +0900
committerJunio C Hamano <gitster@pobox.com>2023-01-05 15:07:22 +0900
commitbc58ebf84e2729a60175baf6a7bb967b31f934bf (patch)
tree6636cafc89a0e1656aec3d6c119ff82b4f002b1e /builtin
parentMerge branch 'km/doc-branch-start-point' (diff)
parentbundle <cmd>: have usage_msg_opt() note the missing "<file>" (diff)
downloadgit-bc58ebf84e2729a60175baf6a7bb967b31f934bf.tar.gz
git-bc58ebf84e2729a60175baf6a7bb967b31f934bf.zip
Merge branch 'ab/bundle-wo-args'
Fix to a small regression in 2.38 days. * ab/bundle-wo-args: bundle <cmd>: have usage_msg_opt() note the missing "<file>" builtin/bundle.c: remove superfluous "newargc" variable bundle: don't segfault on "git bundle <subcmd>"
Diffstat (limited to 'builtin')
-rw-r--r--builtin/bundle.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c
index c12c09f854..acceef6200 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -55,13 +55,12 @@ static int parse_options_cmd_bundle(int argc,
const char * const usagestr[],
const struct option options[],
char **bundle_file) {
- int newargc;
- newargc = parse_options(argc, argv, NULL, options, usagestr,
+ argc = parse_options(argc, argv, NULL, options, usagestr,
PARSE_OPT_STOP_AT_NON_OPTION);
- if (argc < 1)
- usage_with_options(usagestr, options);
+ if (!argc)
+ usage_msg_opt(_("need a <file> argument"), usagestr, options);
*bundle_file = prefix_filename(prefix, argv[0]);
- return newargc;
+ return argc;
}
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {