]> git.ipfire.org Git - thirdparty/git.git/commit - config.h
Add and use generic name->id mapping code for color slot parsing
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 26 May 2018 13:55:21 +0000 (15:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 May 2018 05:51:28 +0000 (14:51 +0900)
commita73b3680c4910866e3e215c3927a0c71f0b9229d
tree4c48aca0f71bba28888b19f3dec47088334ea7d1
parent17b3e5150506281fd2d675c150cf1e71f914ad54
Add and use generic name->id mapping code for color slot parsing

Instead of hard coding the name-to-id mapping in C code, keep it in an
array and use a common function to do the parsing. This reduces code
and also allows us to list all possible color slots later.

This starts using C99 designated initializers more for convenience
(the first designated initializers have been introduced in builtin/clean.c
for some time without complaints)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c
builtin/clean.c
builtin/commit.c
config.c
config.h
diff.c
log-tree.c