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

Function read_mmblob

xdiff-interface.c:179–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void read_mmblob(mmfile_t *ptr, struct object_database *odb,
180 const struct object_id *oid)
181{
182 size_t size;
183 enum object_type type;
184
185 if (is_null_oid(oid)) {
186 ptr->ptr = xstrdup("");
187 ptr->size = 0;
188 return;
189 }
190
191 ptr->ptr = odb_read_object(odb, oid, &type, &size);
192 if (!ptr->ptr || type != OBJ_BLOB)
193 die("unable to read blob object %s", oid_to_hex(oid));
194 ptr->size = size;
195}
196
197#define FIRST_FEW_BYTES 8000
198int buffer_is_binary(const char *ptr, unsigned long size)

Callers 5

merge_3wayFunction · 0.85
ll_merge_in_worktreeFunction · 0.85
three_way_mergeFunction · 0.85
checkout_mergedFunction · 0.85
cmd_merge_fileFunction · 0.85

Calls 5

is_null_oidFunction · 0.85
xstrdupFunction · 0.85
odb_read_objectFunction · 0.85
oid_to_hexFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected