aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-06-20 15:45:13 -0700
committerJunio C Hamano <gitster@pobox.com>2024-06-20 15:45:13 -0700
commit4401639f9656fc0a57248e0059ae07aa3a24596a (patch)
tree2f7d9e680868bd4542d5d9ae6f6db9b8ea4854c2 /config.c
parent9071453ef69ca992e257db8cef4daac6a2d70e1c (diff)
parent037df60013bb3f1534d4db6bf850d7547f1c1d13 (diff)
downloadgit-4401639f9656fc0a57248e0059ae07aa3a24596a.tar.gz
Merge branch 'ps/abbrev-length-before-setup-fix'
Setting core.abbrev too early before the repository set-up (typically in "git clone") caused segfault, which as been corrected. * ps/abbrev-length-before-setup-fix: object-name: don't try to abbreviate to lengths greater than hexsz parse-options-cb: stop clamping "--abbrev=" to hash length config: fix segfault when parsing "core.abbrev" without repo
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index ea355f28ec..8fc7ecf921 100644
--- a/config.c
+++ b/config.c
@@ -1460,10 +1460,10 @@ static int git_default_core_config(const char *var, const char *value,
if (!strcasecmp(value, "auto"))
default_abbrev = -1;
else if (!git_parse_maybe_bool_text(value))
- default_abbrev = the_hash_algo->hexsz;
+ default_abbrev = GIT_MAX_HEXSZ;
else {
int abbrev = git_config_int(var, value, ctx->kvi);
- if (abbrev < minimum_abbrev || abbrev > the_hash_algo->hexsz)
+ if (abbrev < minimum_abbrev)
return error(_("abbrev length out of range: %d"), abbrev);
default_abbrev = abbrev;
}