diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-31 13:32:06 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-31 13:32:06 -0800 |
commit | 46ab22261661a8b4d2e86badc55d26017739dc31 (patch) | |
tree | e9352ba61eff34622265b97c350b29b6cc3eddd4 /config.c | |
parent | 867ce0416c74ac5d403765ea94673ab8969b1a81 (diff) | |
parent | 48d5014dd42cc4a4465162c9807eaa253715e105 (diff) | |
download | git-46ab22261661a8b4d2e86badc55d26017739dc31.tar.gz |
Merge branch 'jc/abbrev-autoscale-config' into maint
Recent update to the default abbreviation length that auto-scales
lacked documentation update, which has been corrected.
* jc/abbrev-autoscale-config:
config.abbrev: document the new default that auto-scales
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -836,10 +836,16 @@ static int git_default_core_config(const char *var, const char *value) } if (!strcmp(var, "core.abbrev")) { - int abbrev = git_config_int(var, value); - if (abbrev < minimum_abbrev || abbrev > 40) - return -1; - default_abbrev = abbrev; + if (!value) + return config_error_nonbool(var); + if (!strcasecmp(value, "auto")) + default_abbrev = -1; + else { + int abbrev = git_config_int(var, value); + if (abbrev < minimum_abbrev || abbrev > 40) + return error("abbrev length out of range: %d", abbrev); + default_abbrev = abbrev; + } return 0; } |