Skip to content

Commit e778ecb

Browse files
avargitster
authored andcommitted
builtin/bundle.c: remove superfluous "newargc" variable
As noted in 891cb09 (bundle: don't segfault on "git bundle <subcmd>", 2022-12-20) the "newargc" in this function is redundant to using our own "argc". Let's refactor the function to avoid needlessly introducing another variable. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 891cb09 commit e778ecb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

builtin/bundle.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ static int parse_options_cmd_bundle(int argc,
4545
const char * const usagestr[],
4646
const struct option options[],
4747
char **bundle_file) {
48-
int newargc;
49-
newargc = parse_options(argc, argv, NULL, options, usagestr,
48+
argc = parse_options(argc, argv, NULL, options, usagestr,
5049
PARSE_OPT_STOP_AT_NON_OPTION);
51-
if (!newargc)
50+
if (!argc)
5251
usage_with_options(usagestr, options);
5352
*bundle_file = prefix_filename(prefix, argv[0]);
54-
return newargc;
53+
return argc;
5554
}
5655

5756
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {

0 commit comments

Comments
 (0)