diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-02-04 23:48:32 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-26 01:16:32 (GMT) |
commit | 44439c1c5827480f68b37c3cc38f257eaeb3ed2c (patch) | |
tree | 405962dbb5c68dbc18a2082a066c75a21a669b1d /cache-tree.c | |
parent | 0ff7b4f976b78ab38313356b3e0582e5fa9a3bcc (diff) | |
download | git-44439c1c5827480f68b37c3cc38f257eaeb3ed2c.zip git-44439c1c5827480f68b37c3cc38f257eaeb3ed2c.tar.gz git-44439c1c5827480f68b37c3cc38f257eaeb3ed2c.tar.bz2 |
object-file API: have hash_object_file() take "enum object_type"
Change the hash_object_file() function to take an "enum
object_type".
Since a preceding commit all of its callers are passing either
"{commit,tree,blob,tag}_type", or the result of a call to type_name(),
the parse_object() caller that would pass NULL is now using
stream_object_signature().
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.c')
-rw-r--r-- | cache-tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cache-tree.c b/cache-tree.c index fdbbd19..6752f69 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -432,14 +432,14 @@ static int update_one(struct cache_tree *it, if (repair) { struct object_id oid; hash_object_file(the_hash_algo, buffer.buf, buffer.len, - tree_type, &oid); + OBJ_TREE, &oid); if (has_object_file_with_flags(&oid, OBJECT_INFO_SKIP_FETCH_OBJECT)) oidcpy(&it->oid, &oid); else to_invalidate = 1; } else if (dryrun) { hash_object_file(the_hash_algo, buffer.buf, buffer.len, - tree_type, &it->oid); + OBJ_TREE, &it->oid); } else if (write_object_file_flags(buffer.buf, buffer.len, OBJ_TREE, &it->oid, flags & WRITE_TREE_SILENT ? HASH_SILENT : 0)) { @@ -948,7 +948,7 @@ static int verify_one(struct repository *r, strbuf_addf(&tree_buf, "%o %.*s%c", mode, entlen, name, '\0'); strbuf_add(&tree_buf, oid->hash, r->hash_algo->rawsz); } - hash_object_file(r->hash_algo, tree_buf.buf, tree_buf.len, tree_type, + hash_object_file(r->hash_algo, tree_buf.buf, tree_buf.len, OBJ_TREE, &new_oid); if (!oideq(&new_oid, &it->oid)) BUG("cache-tree for path %.*s does not match. " |