]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cache-tree: use given repo's hash_algo at verify_one()
authorMatheus Tavares <matheus.bernardino@usp.br>
Thu, 30 Jan 2020 20:32:18 +0000 (17:32 -0300)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Jan 2020 18:45:39 +0000 (10:45 -0800)
verify_one() takes a struct repository argument but uses the_hash_algo
internally. Replace it with the provided repo's git_hash_algo, for
consistency. For now, this is mainly a cosmetic change, as all callers
of this function currently only pass the_repository to it.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c

index 1bd1b23d38d3f4ae59154fb107fbb0b824515970..8c51a1575169c3ee5965d240fc6f8c860c114abe 100644 (file)
@@ -826,7 +826,7 @@ static void verify_one(struct repository *r,
                        i++;
                }
                strbuf_addf(&tree_buf, "%o %.*s%c", mode, entlen, name, '\0');
-               strbuf_add(&tree_buf, oid->hash, the_hash_algo->rawsz);
+               strbuf_add(&tree_buf, oid->hash, r->hash_algo->rawsz);
        }
        hash_object_file(tree_buf.buf, tree_buf.len, tree_type, &new_oid);
        if (!oideq(&new_oid, &it->oid))