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

Function apply_fragments

apply.c:3356–3378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3354}
3355
3356static int apply_fragments(struct apply_state *state, struct image *img, struct patch *patch)
3357{
3358 struct fragment *frag = patch->fragments;
3359 const char *name = patch->old_name ? patch->old_name : patch->new_name;
3360 unsigned ws_rule = patch->ws_rule;
3361 unsigned inaccurate_eof = patch->inaccurate_eof;
3362 int nth = 0;
3363
3364 if (patch->is_binary)
3365 return apply_binary(state, img, patch);
3366
3367 while (frag) {
3368 nth++;
3369 if (apply_one_fragment(state, img, frag, inaccurate_eof, ws_rule, nth)) {
3370 error(_("patch failed: %s:%ld"), name, frag->oldpos);
3371 if (!state->apply_with_reject)
3372 return -1;
3373 frag->rejected = 1;
3374 }
3375 frag = frag->next;
3376 }
3377 return 0;
3378}
3379
3380static int read_blob_object(struct strbuf *buf, const struct object_id *oid, unsigned mode)
3381{

Callers 2

try_threewayFunction · 0.85
apply_dataFunction · 0.85

Calls 3

apply_binaryFunction · 0.85
apply_one_fragmentFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected