diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-12-20 21:49:33 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-12-20 21:49:33 -0800 |
| commit | 2e13ed4671d12ff996b1b44cf5a33de4d2c54b55 (patch) | |
| tree | c13d4bfb569f7714c60f07280aa26c26b7b17b48 /parse-options.c | |
| parent | Git 2.43 (diff) | |
| parent | parse-options: decouple "--end-of-options" and "--" (diff) | |
| download | git-2e13ed4671d12ff996b1b44cf5a33de4d2c54b55.tar.gz git-2e13ed4671d12ff996b1b44cf5a33de4d2c54b55.zip | |
Merge branch 'jk/end-of-options' into jc/sparse-checkout-set-add-end-of-options
* jk/end-of-options:
parse-options: decouple "--end-of-options" and "--"
Diffstat (limited to 'parse-options.c')
| -rw-r--r-- | parse-options.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/parse-options.c b/parse-options.c index e0c94b0546..d50962062e 100644 --- a/parse-options.c +++ b/parse-options.c @@ -929,13 +929,18 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx, continue; } - if (!arg[2] /* "--" */ || - !strcmp(arg + 2, "end-of-options")) { + if (!arg[2] /* "--" */) { if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) { ctx->argc--; ctx->argv++; } break; + } else if (!strcmp(arg + 2, "end-of-options")) { + if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN_OPT)) { + ctx->argc--; + ctx->argv++; + } + break; } if (internal_help && !strcmp(arg + 2, "help-all")) |
