MCPcopy Create free account
hub / github.com/git/git / index_stream_convert_blob

Function index_stream_convert_blob

object-file.c:1027–1051  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025}
1026
1027static 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
1053static int index_pipe(struct index_state *istate, struct object_id *oid,
1054 int fd, enum object_type type,

Callers 1

index_fdFunction · 0.85

Calls 6

convert_to_git_filter_fdFunction · 0.85
get_conv_flagsFunction · 0.85
odb_write_objectFunction · 0.85
hash_object_fileFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected