diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:39 -0700 |
commit | 37aac3e408fa2348983e964f8bda2de581f2c44e (patch) | |
tree | 1a59edd1eb2ece6e597342460b5b199ef2c5624b /pretty.c | |
parent | Merge branch 'en/t6036-recursive-corner-cases' (diff) | |
parent | pretty: switch hard-coded constants to the_hash_algo (diff) | |
download | tgif-37aac3e408fa2348983e964f8bda2de581f2c44e.tar.xz |
Merge branch 'bc/object-id'
Conversion from uchar[40] to struct object_id continues.
* bc/object-id:
pretty: switch hard-coded constants to the_hash_algo
sha1-file: convert constants to uses of the_hash_algo
log-tree: switch GIT_SHA1_HEXSZ to the_hash_algo->hexsz
diff: switch GIT_SHA1_HEXSZ to use the_hash_algo
builtin/merge-recursive: make hash independent
builtin/merge: switch to use the_hash_algo
builtin/fmt-merge-msg: make hash independent
builtin/update-index: simplify parsing of cacheinfo
builtin/update-index: convert to using the_hash_algo
refs/files-backend: use the_hash_algo for writing refs
sha1-name: use the_hash_algo when parsing object names
strbuf: allocate space with GIT_MAX_HEXSZ
commit: express tree entry constants in terms of the_hash_algo
hex: switch to using the_hash_algo
tree-walk: replace hard-coded constants with the_hash_algo
cache: update object ID functions for the_hash_algo
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |