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-26 02:16:31 +0100 |
commit | c80d226a046170b1c8dd82ef72a27373ddd5880e (patch) | |
tree | b4929eb612436c3ec74193cfc99472bc8da443d7 /builtin/checkout.c | |
parent | object-file API: add a format_object_header() function (diff) | |
download | git-c80d226a046170b1c8dd82ef72a27373ddd5880e.tar.xz git-c80d226a046170b1c8dd82ef72a27373ddd5880e.zip |
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/checkout.c')
-rw-r--r-- | builtin/checkout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index cc804ba8e1..24cc235939 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -298,7 +298,7 @@ static int checkout_merged(int pos, const struct checkout *state, * (it also writes the merge result to the object database even * when it may contain conflicts). */ - if (write_object_file(result_buf.ptr, result_buf.size, blob_type, &oid)) + if (write_object_file(result_buf.ptr, result_buf.size, OBJ_BLOB, &oid)) die(_("Unable to add merge result for '%s'"), path); free(result_buf.ptr); ce = make_transient_cache_entry(mode, &oid, path, 2, ce_mem_pool); |