aboutsummaryrefslogtreecommitdiffstats
path: root/object-name.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 /object-name.c
parentMerge branch 'rj/format-patch-auto-cover-with-interdiff' (diff)
parentobject-name: don't try to abbreviate to lengths greater than hexsz (diff)
downloadgit-4401639f9656fc0a57248e0059ae07aa3a24596a.tar.gz
git-4401639f9656fc0a57248e0059ae07aa3a24596a.zip
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 'object-name.c')
-rw-r--r--object-name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object-name.c b/object-name.c
index 523af6f64f..1be2ad1a16 100644
--- a/object-name.c
+++ b/object-name.c
@@ -837,7 +837,7 @@ int repo_find_unique_abbrev_r(struct repository *r, char *hex,
}
oid_to_hex_r(hex, oid);
- if (len == hexsz || !len)
+ if (len >= hexsz || !len)
return hexsz;
mad.repo = r;