aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-05 00:48:34 +0100
committerJunio C Hamano <gitster@pobox.com>2022-02-25 17:16:32 -0800
commit6aea6baeb3ece6c832dbdf1deed09f41aebf85c2 (patch)
treebcfb7909cdbe80e78dbe3cc4281b1a7a777a473b /builtin/pack-objects.c
parentobject-file.c: add a literal version of write_object_file_prepare() (diff)
downloadgit-6aea6baeb3ece6c832dbdf1deed09f41aebf85c2.tar.gz
git-6aea6baeb3ece6c832dbdf1deed09f41aebf85c2.zip
object-file API: pass an enum to read_object_with_reference()
Change the read_object_with_reference() function to take an "enum object_type". It was not prepared to handle an arbitrary "const char *type", as it was itself calling type_from_string(). Let's change the only caller that passes in user data to use type_from_string(), and convert the rest to use e.g. "OBJ_TREE" instead of "tree_type". The "cat-file" caller is not on the codepath that handles"--allow-unknown", so the type_from_string() there is safe. Its use of type_from_string() doesn't functionally differ from that of the pre-image. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index ba2006f221..c4df3df314 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1802,7 +1802,7 @@ static void add_preferred_base(struct object_id *oid)
return;
data = read_object_with_reference(the_repository, oid,
- tree_type, &size, &tree_oid);
+ OBJ_TREE, &size, &tree_oid);
if (!data)
return;