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

Function reverse_patches

apply.c:2330–2347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2328}
2329
2330static void reverse_patches(struct patch *p)
2331{
2332 for (; p; p = p->next) {
2333 struct fragment *frag = p->fragments;
2334
2335 SWAP(p->new_name, p->old_name);
2336 if (p->new_mode || p->is_delete)
2337 SWAP(p->new_mode, p->old_mode);
2338 SWAP(p->is_new, p->is_delete);
2339 SWAP(p->lines_added, p->lines_deleted);
2340 SWAP(p->old_oid_prefix, p->new_oid_prefix);
2341
2342 for (; frag; frag = frag->next) {
2343 SWAP(frag->newpos, frag->oldpos);
2344 SWAP(frag->newlines, frag->oldlines);
2345 }
2346 }
2347}
2348
2349static const char pluses[] =
2350"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";

Callers 1

apply_patchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected