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

Function fill_origin_blob

blame.c:1031–1063  ·  view source on GitHub ↗

* Given an origin, prepare mmfile_t structure to be used by the * diff machinery */

Source from the content-addressed store, hash-verified

1029 * diff machinery
1030 */
1031static void fill_origin_blob(struct diff_options *opt,
1032 struct blame_origin *o, mmfile_t *file,
1033 int *num_read_blob, int fill_fingerprints)
1034{
1035 if (!o->file.ptr) {
1036 enum object_type type;
1037 unsigned long file_size;
1038
1039 (*num_read_blob)++;
1040 if (opt->flags.allow_textconv &&
1041 textconv_object(opt->repo, o->path, o->mode,
1042 &o->blob_oid, 1, &file->ptr, &file_size))
1043 ;
1044 else {
1045 size_t file_size_st = 0;
1046 file->ptr = odb_read_object(the_repository->objects,
1047 &o->blob_oid, &type,
1048 &file_size_st);
1049 file_size = cast_size_t_to_ulong(file_size_st);
1050 }
1051 file->size = file_size;
1052
1053 if (!file->ptr)
1054 die("Cannot read blob %s for path %s",
1055 oid_to_hex(&o->blob_oid),
1056 o->path);
1057 o->file = *file;
1058 }
1059 else
1060 *file = o->file;
1061 if (fill_fingerprints)
1062 fill_origin_fingerprints(o);
1063}
1064
1065static void drop_origin_blob(struct blame_origin *o)
1066{

Callers 3

pass_blame_to_parentFunction · 0.85
find_move_in_parentFunction · 0.85
find_copy_in_parentFunction · 0.85

Calls 6

textconv_objectFunction · 0.85
odb_read_objectFunction · 0.85
cast_size_t_to_ulongFunction · 0.85
oid_to_hexFunction · 0.85
fill_origin_fingerprintsFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected