summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorLibravatar Taylor Blau <me@ttaylorr.com>2018-04-09 15:46:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-04-10 10:22:29 +0900
commit0a8950be5d5d8699b4c1f31116bdf896278db484 (patch)
tree4daf908eef8bbe64cbaaa5842d6f4e765cf62664 /transport-helper.c
parentGit 2.17-rc2 (diff)
downloadtgif-0a8950be5d5d8699b4c1f31116bdf896278db484.tar.xz
builtin/config.c: treat type specifiers singularly
Internally, we represent `git config`'s type specifiers as a bitset using OPT_BIT. 'bool' is 1<<0, 'int' is 1<<1, and so on. This technique allows for the representation of multiple type specifiers in the `int types` field, but this multi-representation is left unused. In fact, `git config` will not accept multiple type specifiers at a time, as indicated by: $ git config --int --bool some.section error: only one type at a time. This patch uses `OPT_SET_INT` to prefer the _last_ mentioned type specifier, so that the above command would instead be valid, and a synonym of: $ git config --bool some.section This change is motivated by two urges: (1) it does not make sense to represent a singular type specifier internally as a bitset, only to complain when there are multiple bits in the set. `OPT_SET_INT` is more well-suited to this task than `OPT_BIT` is. (2) a future patch will introduce `--type=<type>`, and we would like not to complain in the following situation: $ git config --int --type=int Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
0 files changed, 0 insertions, 0 deletions