diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-22 12:29:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-22 12:29:00 +0300 |
commit | 99fe1c606925ecd427af6e0338ec18936407ba48 (patch) | |
tree | 8ed84325c439f2161584e2e3efbc8c68d462d4c3 /builtin | |
parent | 107691cb07aab771585844fcd39d5e1c7f1ed14b (diff) | |
parent | 99fc555188681caeedc983b9fc982d6dc8ee2a8c (diff) |
Merge branch 'wm/rev-parse-path-format-wo-arg'
The "rev-parse" command did not diagnose the lack of argument to
"--path-format" option, which was introduced in v2.31 era, which
has been corrected.
* wm/rev-parse-path-format-wo-arg:
rev-parse: fix segfault with missing --path-format argument
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/rev-parse.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 85bad9052e..7af8dab8bc 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -759,6 +759,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) continue; } if (opt_with_value(arg, "--path-format", &arg)) { + if (!arg) + die("--path-format requires an argument"); if (!strcmp(arg, "absolute")) { format = FORMAT_CANONICAL; } else if (!strcmp(arg, "relative")) { |