diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-02-05 00:48:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-25 17:16:31 -0800 |
commit | c80d226a046170b1c8dd82ef72a27373ddd5880e (patch) | |
tree | b4929eb612436c3ec74193cfc99472bc8da443d7 /cache-tree.c | |
parent | b04cdea46cf5ae60066fa6dd12d5449bf3ef283f (diff) | |
download | git-c80d226a046170b1c8dd82ef72a27373ddd5880e.tar.gz |
object-file API: have write_object_file() take "enum object_type"
Change the write_object_file() function to take an "enum object_type"
instead of a "const char *type". Its callers either passed
{commit,tree,blob,tag}_type and can pass the corresponding OBJ_* type
instead, or were hardcoding strings like "blob".
This avoids the back & forth fragility where the callers of
write_object_file() would have the enum type, and convert it
themselves via type_name(). We do have to now do that conversion
ourselves before calling write_object_file_prepare(), but those
codepaths will be similarly adjusted in subsequent commits.
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 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cache-tree.c b/cache-tree.c index 65ca993361..fdbbd191d2 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -440,7 +440,7 @@ static int update_one(struct cache_tree *it, } else if (dryrun) { hash_object_file(the_hash_algo, buffer.buf, buffer.len, tree_type, &it->oid); - } else if (write_object_file_flags(buffer.buf, buffer.len, tree_type, + } else if (write_object_file_flags(buffer.buf, buffer.len, OBJ_TREE, &it->oid, flags & WRITE_TREE_SILENT ? HASH_SILENT : 0)) { strbuf_release(&buffer); |