summaryrefslogtreecommitdiff
path: root/builtin/merge-recursive.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-07-16 01:28:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-16 21:27:39 (GMT)
commitb7f20f72047f3ec22c7daff61a40f52f85ad0b3a (patch)
tree594cd42e4f3d2ab41045606e0fda53b5b8e5d008 /builtin/merge-recursive.c
parentab47df2d9a1d07380a02c9be2c57bca1cfbb054e (diff)
downloadgit-b7f20f72047f3ec22c7daff61a40f52f85ad0b3a.zip
git-b7f20f72047f3ec22c7daff61a40f52f85ad0b3a.tar.gz
git-b7f20f72047f3ec22c7daff61a40f52f85ad0b3a.tar.bz2
builtin/merge-recursive: make hash independent
Use GIT_MAX_HEXSZ instead of GIT_SHA1_HEXSZ for an allocation so that it is sufficiently large. Switch a comparison to use the_hash_algo to determine the length of a hex object ID. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-recursive.c')
-rw-r--r--builtin/merge-recursive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index 0dd9021..9b2f707 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -9,10 +9,10 @@ static const char builtin_merge_recursive_usage[] =
static const char *better_branch_name(const char *branch)
{
- static char githead_env[8 + GIT_SHA1_HEXSZ + 1];
+ static char githead_env[8 + GIT_MAX_HEXSZ + 1];
char *name;
- if (strlen(branch) != GIT_SHA1_HEXSZ)
+ if (strlen(branch) != the_hash_algo->hexsz)
return branch;
xsnprintf(githead_env, sizeof(githead_env), "GITHEAD_%s", branch);
name = getenv(githead_env);