repository.h: drop extern from function declaration
[gitweb.git] / pretty.c
index cde4fe07db0403d8cb63848842a4db26f62c12c7..2b12da324bc0171c24fd88b6da636f70cd11f214 100644 (file)
--- 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;
                }