]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/bundle.c: remove superfluous "newargc" variable
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 27 Dec 2022 18:39:09 +0000 (19:39 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Dec 2022 23:30:01 +0000 (08:30 +0900)
As noted in 891cb09db6c (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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/bundle.c

index 13309f2ea9133a24233630760cda3a6df604fb42..34b4aa611b5e6aa22e6a36459eb70ac800d2bb20 100644 (file)
@@ -45,13 +45,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 (!newargc)
+       if (!argc)
                usage_with_options(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) {