diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-03-24 11:20:04 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-03-24 16:21:22 +0300 |
commit | d877418390168c9696fd46d5e78ca3362f26f74c (patch) | |
tree | 822a8c0457a95d8b171689c528d98036198eba87 /parse-options-cb.c | |
parent | d2d3f27300967e76e0c9f3a916e7e236ff95f1aa (diff) |
diff-parseopt: convert --[no-]abbrev
OPT__ABBREV() has the same behavior as the deleted code with one
difference: it does check for valid number and error out if not. And the
'40' change is self explanatory.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options-cb.c')
-rw-r--r-- | parse-options-cb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/parse-options-cb.c b/parse-options-cb.c index 2733393546..6e2e8d6273 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@ -22,8 +22,8 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset) opt->long_name); if (v && v < MINIMUM_ABBREV) v = MINIMUM_ABBREV; - else if (v > 40) - v = 40; + else if (v > the_hash_algo->hexsz) + v = the_hash_algo->hexsz; } *(int *)(opt->value) = v; return 0; |