path: root/builtin/merge.c
diff options
authorbrian m. carlson <>2017-03-26 16:01:24 (GMT)
committerJunio C Hamano <>2017-03-27 05:08:21 (GMT)
commitdc01505f7f272a44b974e622f75bd592debe9dcb (patch)
tree7aa62babd604067a3d928edfa988391711a36007 /builtin/merge.c
parent5028bf628c7ebfb85d14ec7dc296b264a1c3bcd3 (diff)
Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ
Since we will likely be introducing a new hash function at some point, and that hash function might be longer than 40 hex characters, use the constant GIT_MAX_HEXSZ, which is designed to be suitable for allocations, instead of GIT_SHA1_HEXSZ. This will ease the transition down the line by distinguishing between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/merge.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 7554b8d..a2cceea 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1296,7 +1296,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (verify_signatures) {
for (p = remoteheads; p; p = p->next) {
struct commit *commit = p->item;
- char hex[GIT_SHA1_HEXSZ + 1];
+ char hex[GIT_MAX_HEXSZ + 1];
struct signature_check signature_check;
memset(&signature_check, 0, sizeof(signature_check));