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>"
This commit is contained in:
		@ -55,13 +55,12 @@ static int parse_options_cmd_bundle(int argc,
 | 
				
			|||||||
		const char * const usagestr[],
 | 
							const char * const usagestr[],
 | 
				
			||||||
		const struct option options[],
 | 
							const struct option options[],
 | 
				
			||||||
		char **bundle_file) {
 | 
							char **bundle_file) {
 | 
				
			||||||
	int newargc;
 | 
						argc = parse_options(argc, argv, NULL, options, usagestr,
 | 
				
			||||||
	newargc = parse_options(argc, argv, NULL, options, usagestr,
 | 
					 | 
				
			||||||
			     PARSE_OPT_STOP_AT_NON_OPTION);
 | 
								     PARSE_OPT_STOP_AT_NON_OPTION);
 | 
				
			||||||
	if (argc < 1)
 | 
						if (!argc)
 | 
				
			||||||
		usage_with_options(usagestr, options);
 | 
							usage_msg_opt(_("need a <file> argument"), usagestr, options);
 | 
				
			||||||
	*bundle_file = prefix_filename(prefix, argv[0]);
 | 
						*bundle_file = prefix_filename(prefix, argv[0]);
 | 
				
			||||||
	return newargc;
 | 
						return argc;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
 | 
					static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
 | 
				
			||||||
 | 
				
			|||||||
@ -11,6 +11,13 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 | 
				
			|||||||
. ./test-lib.sh
 | 
					. ./test-lib.sh
 | 
				
			||||||
. "$TEST_DIRECTORY"/lib-bundle.sh
 | 
					. "$TEST_DIRECTORY"/lib-bundle.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for cmd in create verify list-heads unbundle
 | 
				
			||||||
 | 
					do
 | 
				
			||||||
 | 
						test_expect_success "usage: git bundle $cmd needs an argument" '
 | 
				
			||||||
 | 
							test_expect_code 129 git bundle $cmd
 | 
				
			||||||
 | 
						'
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Create a commit or tag and set the variable with the object ID.
 | 
					# Create a commit or tag and set the variable with the object ID.
 | 
				
			||||||
test_commit_setvar () {
 | 
					test_commit_setvar () {
 | 
				
			||||||
	notick=
 | 
						notick=
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user