diff options
author | Patrick Steinhardt <ps@pks.im> | 2025-04-15 11:38:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-04-15 08:24:36 -0700 |
commit | 70c0f9db4e00586e4df5cca24fe7ce05848ee59c (patch) | |
tree | 54480f65c224dbe45dd0d35bbecbbfd07eac6044 /builtin/replace.c | |
parent | d9f517d051d1008178cb6c809b5f906d0905508f (diff) |
object-file: split up concerns of `HASH_*` flags
The functions `hash_object_file()`, `write_object_file()` and
`index_fd()` reuse the same set of flags to alter their behaviour. This
not only adds confusion, but given that every function only supports a
subset of the flags it becomes very hard to see which flags can be
passed to what function. Last but not least, this entangles the
implementation of all three function families.
Split up concerns by creating separate flags for each of the function
families.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/replace.c')
-rw-r--r-- | builtin/replace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/replace.c b/builtin/replace.c index 15ec0922ce..2b4fc9a68b 100644 --- a/builtin/replace.c +++ b/builtin/replace.c @@ -305,7 +305,7 @@ static int import_object(struct object_id *oid, enum object_type type, strbuf_release(&result); } else { struct stat st; - int flags = HASH_FORMAT_CHECK | HASH_WRITE_OBJECT; + int flags = INDEX_FORMAT_CHECK | INDEX_WRITE_OBJECT; if (fstat(fd, &st) < 0) { error_errno(_("unable to fstat %s"), filename); |