Skip to content

Commit 5205749

Browse files
peffgitster
authored andcommitted
parse-options: drop unused ctx parameter from show_gitcomp()
The completion display doesn't actually care about where we are in the parsing. It's generated completely from the set of available options. So we don't need to see the parse-options context struct at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 0f804b0 commit 5205749

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

parse-options.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,7 @@ static void show_negated_gitcomp(const struct option *opts, int nr_noopts)
523523
}
524524
}
525525

526-
static int show_gitcomp(struct parse_opt_ctx_t *ctx,
527-
const struct option *opts)
526+
static int show_gitcomp(const struct option *opts)
528527
{
529528
const struct option *original_opts = opts;
530529
int nr_noopts = 0;
@@ -603,7 +602,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
603602

604603
/* lone --git-completion-helper is asked by git-completion.bash */
605604
if (ctx->total == 1 && !strcmp(arg + 1, "-git-completion-helper"))
606-
return show_gitcomp(ctx, options);
605+
return show_gitcomp(options);
607606

608607
if (arg[1] != '-') {
609608
ctx->opt = arg + 1;

0 commit comments

Comments
 (0)