summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-04 23:48:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-26 01:16:31 (GMT)
commitc80d226a046170b1c8dd82ef72a27373ddd5880e (patch)
treeb4929eb612436c3ec74193cfc99472bc8da443d7 /commit.c
parentb04cdea46cf5ae60066fa6dd12d5449bf3ef283f (diff)
downloadgit-c80d226a046170b1c8dd82ef72a27373ddd5880e.zip
git-c80d226a046170b1c8dd82ef72a27373ddd5880e.tar.gz
git-c80d226a046170b1c8dd82ef72a27373ddd5880e.tar.bz2
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 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index a348f08..6cc0ba9 100644
--- a/commit.c
+++ b/commit.c
@@ -1567,7 +1567,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,
goto out;
}
- result = write_object_file(buffer.buf, buffer.len, commit_type, ret);
+ result = write_object_file(buffer.buf, buffer.len, OBJ_COMMIT, ret);
out:
strbuf_release(&buffer);
return result;