]> git.ipfire.org Git - thirdparty/git.git/commit - match-trees.c
object-file API: have write_object_file() take "enum object_type"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 4 Feb 2022 23:48:26 +0000 (00:48 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 26 Feb 2022 01:16:31 +0000 (17:16 -0800)
commitc80d226a046170b1c8dd82ef72a27373ddd5880e
treeb4929eb612436c3ec74193cfc99472bc8da443d7
parentb04cdea46cf5ae60066fa6dd12d5449bf3ef283f
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>
19 files changed:
apply.c
builtin/checkout.c
builtin/mktag.c
builtin/mktree.c
builtin/notes.c
builtin/receive-pack.c
builtin/replace.c
builtin/tag.c
builtin/unpack-objects.c
cache-tree.c
commit.c
match-trees.c
merge-ort.c
merge-recursive.c
notes-cache.c
notes.c
object-file.c
object-store.h
read-cache.c