summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-19 22:04:58 (GMT)
commitfe9fec45f68e0d9850bf13da57b3e7a99fc33444 (patch)
treeb4258b5b9d4cf77e19388d04741f6e2b0f92aa03 /config.c
parent976ff7e49d722d1b72effb6d547ec2b00cd69fc0 (diff)
downloadgit-fe9fec45f68e0d9850bf13da57b3e7a99fc33444.zip
git-fe9fec45f68e0d9850bf13da57b3e7a99fc33444.tar.gz
git-fe9fec45f68e0d9850bf13da57b3e7a99fc33444.tar.bz2
config: use the_hash_algo in abbrev comparison
Switch one use of a hard-coded 40 constant to use the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/config.c b/config.c
index 3900e49..b0f79aa 100644
--- a/config.c
+++ b/config.c
@@ -1204,7 +1204,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
default_abbrev = -1;
else {
int abbrev = git_config_int(var, value);
- if (abbrev < minimum_abbrev || abbrev > 40)
+ if (abbrev < minimum_abbrev || abbrev > the_hash_algo->hexsz)
return error(_("abbrev length out of range: %d"), abbrev);
default_abbrev = abbrev;
}