Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-05 02:48:32 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-26 04:16:32 +0300
commit44439c1c5827480f68b37c3cc38f257eaeb3ed2c (patch)
tree405962dbb5c68dbc18a2082a066c75a21a669b1d /cache-tree.c
parent0ff7b4f976b78ab38313356b3e0582e5fa9a3bcc (diff)
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cache-tree.c b/cache-tree.c
index fdbbd191d2..6752f69d51 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. "