| 1025 | } |
| 1026 | |
| 1027 | static int index_stream_convert_blob(struct index_state *istate, |
| 1028 | struct object_id *oid, |
| 1029 | int fd, |
| 1030 | const char *path, |
| 1031 | unsigned flags) |
| 1032 | { |
| 1033 | int ret = 0; |
| 1034 | const int write_object = flags & INDEX_WRITE_OBJECT; |
| 1035 | struct strbuf sbuf = STRBUF_INIT; |
| 1036 | |
| 1037 | assert(path); |
| 1038 | ASSERT(would_convert_to_git_filter_fd(istate, path)); |
| 1039 | |
| 1040 | convert_to_git_filter_fd(istate, path, fd, &sbuf, |
| 1041 | get_conv_flags(flags)); |
| 1042 | |
| 1043 | if (write_object) |
| 1044 | ret = odb_write_object(istate->repo->objects, sbuf.buf, sbuf.len, OBJ_BLOB, |
| 1045 | oid); |
| 1046 | else |
| 1047 | hash_object_file(istate->repo->hash_algo, sbuf.buf, sbuf.len, OBJ_BLOB, |
| 1048 | oid); |
| 1049 | strbuf_release(&sbuf); |
| 1050 | return ret; |
| 1051 | } |
| 1052 | |
| 1053 | static int index_pipe(struct index_state *istate, struct object_id *oid, |
| 1054 | int fd, enum object_type type, |
no test coverage detected