diff options
author | René Scharfe <l.s.r@web.de> | 2024-03-03 13:19:42 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-03 09:49:22 -0800 |
commit | b1ce2b62fa4c6cf6d972698ac48be451cbc07718 (patch) | |
tree | e7e78be8a4f838fa041a843ec780ff1e8bc0c42f /commit.c | |
parent | 0d8a3097c74ed3b78442c4d533f3427316596a46 (diff) |
parse-options: normalize arg and long_name before comparison
Strip "no-" from arg and long_name before comparing them. This way we
no longer have to repeat the comparison with an offset of 3 for negated
arguments.
Note that we must not modify the "flags" value, which tracks whether arg
is negated, inside the loop. When registering "--n", "--no" or "--no-"
as abbreviation for any negative option, we used to OR it with OPT_UNSET
and end the loop. We can simply hard-code OPT_UNSET and leave flags
unchanged instead.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions