Re: [PATCH 06/10] object-file API: replace some use of check_object_signature()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 1, 2022, 19:16 UTC
- Message-ID
- <xmqqy22ucs7q.fsf@gitster.g>
- In-Reply-To
- <patch-06.10-2a065bf23da-20220201T144803Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Add a "hash_object_file_literally()" function to go with the existing > "hash_object_file()" function. This is currently a wrapper for its > sibling, but this change will allow us to change it to take an "enum > object_type" in a subsequent commit.
This is a confusing renaming, because there is already a public function that exists under that name. And with this implementation, ...
Show 6 quoted lines
> +static void hash_object_file_literally(const struct git_hash_algo *algo, const void *buf,
> + unsigned long len, const char *type,
> + struct object_id *oid)
> +{
> + hash_object_file(algo, buf, len, type, oid);
> +}... it is dubious why we need it.
Show 6 quoted lines
> -int hash_object_file_literally(const void *buf, unsigned long len, > - const char *type, struct object_id *oid, > - unsigned flags) > +int hash_write_object_file_literally(const void *buf, unsigned long len, > + const char *type, struct object_id *oid, > + unsigned flags)
This renaming is actually OK, if hash_object_file() which is also public is renamed to hash_write_object_file() at the same time.
But I would say we should try to avoid such name churn to the public namespace.