summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-01-15 15:20:28 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-01-15 15:20:28 -0800
commit6dbbae17d9d1f35e7b46d04ba69e453e0a384ac9 (patch)
tree41a8db8c59a11dbe2996c3188a0a740e4020b7bc /config.c
parentThe first batch in 2.31 cycle (diff)
parentcore.abbrev=no disables abbreviations (diff)
downloadtgif-6dbbae17d9d1f35e7b46d04ba69e453e0a384ac9.tar.xz
Merge branch 'ew/decline-core-abbrev'
The configuration variable 'core.abbrev' can be set to 'no' to force no abbreviation regardless of the hash algorithm. * ew/decline-core-abbrev: core.abbrev=no disables abbreviations
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/config.c b/config.c
index 1137bd73af..4c0cf3a1c1 100644
--- a/config.c
+++ b/config.c
@@ -1217,6 +1217,8 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
return config_error_nonbool(var);
if (!strcasecmp(value, "auto"))
default_abbrev = -1;
+ else if (!git_parse_maybe_bool_text(value))
+ default_abbrev = the_hash_algo->hexsz;
else {
int abbrev = git_config_int(var, value);
if (abbrev < minimum_abbrev || abbrev > the_hash_algo->hexsz)