summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-05 00:48:26 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 17:16:31 -0800
commitc80d226a046170b1c8dd82ef72a27373ddd5880e (patch)
treeb4929eb612436c3ec74193cfc99472bc8da443d7 /builtin/receive-pack.c
parentobject-file API: add a format_object_header() function (diff)
downloadtgif-c80d226a046170b1c8dd82ef72a27373ddd5880e.tar.xz
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 'builtin/receive-pack.c')
-rw-r--r--builtin/receive-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 9f4a0b816c..231d576927 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -762,7 +762,7 @@ static void prepare_push_cert_sha1(struct child_process *proc)
int bogs /* beginning_of_gpg_sig */;
already_done = 1;
- if (write_object_file(push_cert.buf, push_cert.len, "blob",
+ if (write_object_file(push_cert.buf, push_cert.len, OBJ_BLOB,
&push_cert_oid))
oidclr(&push_cert_oid);