mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'nd/log-graph-configurable-colors'
Some people feel the default set of colors used by "git log --graph" rather limiting. A mechanism to customize the set of colors has been introduced. * nd/log-graph-configurable-colors: document behavior of empty color name color_parse_mem: allow empty color spec log --graph: customize the graph lines with config log.graphColors color.c: trim leading spaces in color_parse_mem() color.c: fix color_parse_mem() with value_len == 0
This commit is contained in:
12
color.c
12
color.c
@@ -207,7 +207,17 @@ int color_parse_mem(const char *value, int value_len, char *dst)
|
||||
struct color fg = { COLOR_UNSPECIFIED };
|
||||
struct color bg = { COLOR_UNSPECIFIED };
|
||||
|
||||
if (!strncasecmp(value, "reset", len)) {
|
||||
while (len > 0 && isspace(*ptr)) {
|
||||
ptr++;
|
||||
len--;
|
||||
}
|
||||
|
||||
if (!len) {
|
||||
dst[0] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncasecmp(ptr, "reset", len)) {
|
||||
xsnprintf(dst, end - dst, GIT_COLOR_RESET);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user