Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-12-27 21:39:09 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-28 02:30:01 +0300
commite778ecbcee3a4a14e46c06d66328fdfc0af8780d (patch)
tree34ad4d2cfbf0b5d64547441950ca9a42ccdb5b88 /builtin
parent891cb09db6c0e6bf11b8175bc5ea5f45493afb85 (diff)
builtin/bundle.c: remove superfluous "newargc" variable
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/bundle.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 13309f2ea9..34b4aa611b 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -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) {