summaryrefslogtreecommitdiff
path: root/builtin/hash-object.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-04 23:48:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-26 01:16:32 (GMT)
commit0ff7b4f976b78ab38313356b3e0582e5fa9a3bcc (patch)
treee1540b722fef4fed68ded9fc975c4e5b84b4f2fb /builtin/hash-object.c
parent0f156dbb04b434d95ce5465e6b07d8869d55e8e0 (diff)
downloadgit-0ff7b4f976b78ab38313356b3e0582e5fa9a3bcc.zip
git-0ff7b4f976b78ab38313356b3e0582e5fa9a3bcc.tar.gz
git-0ff7b4f976b78ab38313356b3e0582e5fa9a3bcc.tar.bz2
object API: rename hash_object_file_literally() to write_*()
Before 0c3db67cc81 (hash-object --literally: fix buffer overrun with extra-long object type, 2015-05-04) the hash-object code being changed here called write_sha1_file() to both hash and write a loose object. Before that we'd use hash_sha1_file() to if "-w" wasn't provided, and otherwise call write_sha1_file(). Now we'll always call the same function for both writing. Let's rename it from hash_*_literally() to write_*_literally(). Even though the write_*() might not actually write if HASH_WRITE_OBJECT isn't in "flags", having it be more similar to write_object_file_flags() than hash_object_file(), but carrying a name that would suggest that it's a variant of the latter is confusing. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/hash-object.c')
-rw-r--r--builtin/hash-object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index c7b3ad7..f4cbd9c 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -25,7 +25,7 @@ static int hash_literally(struct object_id *oid, int fd, const char *type, unsig
if (strbuf_read(&buf, fd, 4096) < 0)
ret = -1;
else
- ret = hash_object_file_literally(buf.buf, buf.len, type, oid,
+ ret = write_object_file_literally(buf.buf, buf.len, type, oid,
flags);
strbuf_release(&buf);
return ret;