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>
This commit is contained in:
committed by
Junio C Hamano
parent
d9f517d051
commit
70c0f9db4e
@@ -729,7 +729,7 @@ int notes_merge_commit(struct notes_merge_options *o,
|
||||
/* write file as blob, and add to partial_tree */
|
||||
if (stat(path.buf, &st))
|
||||
die_errno("Failed to stat '%s'", path.buf);
|
||||
if (index_path(o->repo->index, &blob_oid, path.buf, &st, HASH_WRITE_OBJECT))
|
||||
if (index_path(o->repo->index, &blob_oid, path.buf, &st, INDEX_WRITE_OBJECT))
|
||||
die("Failed to write blob object from '%s'", path.buf);
|
||||
if (add_note(partial_tree, &obj_oid, &blob_oid, NULL))
|
||||
die("Failed to add resolved note '%s' to notes tree",
|
||||
|
||||
Reference in New Issue
Block a user