| 2328 | } |
| 2329 | |
| 2330 | static 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 | |
| 2349 | static const char pluses[] = |
| 2350 | "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"; |