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
@@ -304,7 +304,7 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
|
||||
ce->ce_mode = ce_mode_from_stat(old, st->st_mode);
|
||||
|
||||
if (index_path(the_repository->index, &ce->oid, path, st,
|
||||
info_only ? 0 : HASH_WRITE_OBJECT)) {
|
||||
info_only ? 0 : INDEX_WRITE_OBJECT)) {
|
||||
discard_cache_entry(ce);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user