Merge branch 'jk/end-of-options'
"git $cmd --end-of-options --rev -- --path" for some $cmd failed to interpret "--rev" as a rev, and "--path" as a path. This was fixed for many programs like "reset" and "checkout". * jk/end-of-options: parse-options: decouple "--end-of-options" and "--"
This commit is contained in:
@@ -930,13 +930,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"))
|
||||
|
||||
Reference in New Issue
Block a user