Skip to content

Commit b7f20f7

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab47df2 commit b7f20f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/merge-recursive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ static const char builtin_merge_recursive_usage[] =
99

1010
static const char *better_branch_name(const char *branch)
1111
{
12-
static char githead_env[8 + GIT_SHA1_HEXSZ + 1];
12+
static char githead_env[8 + GIT_MAX_HEXSZ + 1];
1313
char *name;
1414

15-
if (strlen(branch) != GIT_SHA1_HEXSZ)
15+
if (strlen(branch) != the_hash_algo->hexsz)
1616
return branch;
1717
xsnprintf(githead_env, sizeof(githead_env), "GITHEAD_%s", branch);
1818
name = getenv(githead_env);

0 commit comments

Comments
 (0)