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

Function diff_delta

delta.h:56–69  ·  view source on GitHub ↗

* diff_delta: create a delta from source buffer to target buffer * * If max_delta_size is non-zero and the resulting delta is to be larger * than max_delta_size then NULL is returned. On success, a non-NULL * pointer to the buffer with the delta data is returned and *delta_size is * updated with its size. The returned buffer must be freed by the caller. */

Source from the content-addressed store, hash-verified

54 * updated with its size. The returned buffer must be freed by the caller.
55 */
56static inline void *
57diff_delta(const void *src_buf, unsigned long src_bufsize,
58 const void *trg_buf, unsigned long trg_bufsize,
59 unsigned long *delta_size, unsigned long max_delta_size)
60{
61 struct delta_index *index = create_delta_index(src_buf, src_bufsize);
62 if (index) {
63 void *delta = create_delta(index, trg_buf, trg_bufsize,
64 delta_size, max_delta_size);
65 free_delta_index(index);
66 return delta;
67 }
68 return NULL;
69}
70
71/*
72 * patch_delta: recreate target buffer given source buffer and delta data

Callers 5

emit_binary_diff_bodyFunction · 0.85
cmd__deltaFunction · 0.85
write_ref_deltaFunction · 0.85
store_objectFunction · 0.85
get_deltaFunction · 0.85

Calls 3

create_delta_indexFunction · 0.85
create_deltaFunction · 0.85
free_delta_indexFunction · 0.85

Tested by 2

cmd__deltaFunction · 0.68
write_ref_deltaFunction · 0.68