diff options
author | René Scharfe <l.s.r@web.de> | 2023-10-28 13:57:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-29 12:05:59 +0900 |
commit | e5cf20e0926b1091f0e80de6e43296a2c3223dba (patch) | |
tree | 0c03a295622fa71ac5a8c2d4b2c55004d83104b9 /git-send-email.perl | |
parent | 0025dde775ea20c64dfedff17da15bbef047a1c9 (diff) |
am: simplify --show-current-patch handling
Let the parse-options code detect and handle the use of options that are
incompatible with --show-current-patch. This requires exposing the
distinction between the "raw" and "diff" sub-modes. Do that by
splitting the mode RESUME_SHOW_PATCH into RESUME_SHOW_PATCH_RAW and
RESUME_SHOW_PATCH_DIFF and stop tracking sub-modes in a separate struct.
The result is a simpler callback function and more precise error
messages. The original reports a spurious argument or a NULL pointer:
$ git am --show-current-patch --show-current-patch=diff
error: options '--show-current-patch=diff' and '--show-current-patch=raw' cannot be used together
$ git am --show-current-patch=diff --show-current-patch
error: options '--show-current-patch=(null)' and '--show-current-patch=diff' cannot be used together
With this patch we get the more precise:
$ git am --show-current-patch --show-current-patch=diff
error: --show-current-patch=diff is incompatible with --show-current-patch
$ git am --show-current-patch=diff --show-current-patch
error: --show-current-patch is incompatible with --show-current-patch=diff
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
0 files changed, 0 insertions, 0 deletions