Merge branch 'nd/config-blame-sort'
[gitweb.git] / pretty.c
index cde4fe07db0403d8cb63848842a4db26f62c12c7..98cf5228f9e30fe5622bdfb4c54d996cb3153808 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1538,7 +1538,7 @@ void format_commit_message(const struct commit *commit,
        }
 
        if (output_enc) {
-               int outsz;
+               size_t outsz;
                char *out = reencode_string_len(sb->buf, sb->len,
                                                output_enc, utf8, &outsz);
                if (out)
@@ -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;
                }