mirror of
https://github.com/git/git.git
synced 2024-09-29 10:51:21 +02:00
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>
This commit is contained in:
parent
0f804b0bac
commit
5205749d2c
@ -523,8 +523,7 @@ static void show_negated_gitcomp(const struct option *opts, int nr_noopts)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int show_gitcomp(struct parse_opt_ctx_t *ctx,
|
static int show_gitcomp(const struct option *opts)
|
||||||
const struct option *opts)
|
|
||||||
{
|
{
|
||||||
const struct option *original_opts = opts;
|
const struct option *original_opts = opts;
|
||||||
int nr_noopts = 0;
|
int nr_noopts = 0;
|
||||||
@ -603,7 +602,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
|
|||||||
|
|
||||||
/* lone --git-completion-helper is asked by git-completion.bash */
|
/* lone --git-completion-helper is asked by git-completion.bash */
|
||||||
if (ctx->total == 1 && !strcmp(arg + 1, "-git-completion-helper"))
|
if (ctx->total == 1 && !strcmp(arg + 1, "-git-completion-helper"))
|
||||||
return show_gitcomp(ctx, options);
|
return show_gitcomp(options);
|
||||||
|
|
||||||
if (arg[1] != '-') {
|
if (arg[1] != '-') {
|
||||||
ctx->opt = arg + 1;
|
ctx->opt = arg + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user