summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-07-16 01:28:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-16 21:27:40 (GMT)
commit580f0980e11b9dcfdaf0f8af12b8cef7c702a7e1 (patch)
tree823d38974c2c4d016d4856c11563518955216aef /pretty.c
parent94b5e093f9434ab77dd0ccb5a6dd2cd3a94e7de5 (diff)
downloadgit-580f0980e11b9dcfdaf0f8af12b8cef7c702a7e1.zip
git-580f0980e11b9dcfdaf0f8af12b8cef7c702a7e1.tar.gz
git-580f0980e11b9dcfdaf0f8af12b8cef7c702a7e1.tar.bz2
pretty: switch hard-coded constants to the_hash_algo
Switch several hard-coded constants into expressions based either on GIT_MAX_HEXSZ or the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pretty.c b/pretty.c
index 703fa6f..b0e653f 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1575,7 +1575,7 @@ static void pp_header(struct pretty_print_context *pp,
}
if (starts_with(line, "parent ")) {
- if (linelen != 48)
+ if (linelen != the_hash_algo->hexsz + 8)
die("bad parent line in commit");
continue;
}
@@ -1583,7 +1583,7 @@ static void pp_header(struct pretty_print_context *pp,
if (!parents_shown) {
unsigned num = commit_list_count(commit->parents);
/* with enough slop */
- strbuf_grow(sb, num * 50 + 20);
+ strbuf_grow(sb, num * (GIT_MAX_HEXSZ + 10) + 20);
add_merge_info(pp, sb, commit);
parents_shown = 1;
}