diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-02-23 15:36:54 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-23 15:36:54 -0800 |
commit | 6733c3e59e689b0d1ff034bf9395051e1319247b (patch) | |
tree | 8a5cfd7134af49ae78a3facedcabb8cffc26e5f5 | |
parent | 8afa92b60029e2de5d98d57f4ab8bb39649f510b (diff) | |
download | git-6733c3e59e689b0d1ff034bf9395051e1319247b.tar.gz |
WIPWIPjc/diff-b-m
-rw-r--r-- | diffcore-rename.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c index f3dc434db1..d7322af876 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -685,12 +685,24 @@ void diffcore_rename(struct diff_options *options) } else if (DIFF_FILE_VALID(p->one) && !DIFF_FILE_VALID(p->two)) { /* * Deletion - * - * Did the content go to somewhere? */ struct diff_rename_src *src = locate_rename_src(p->one, 0); - if (!src || !src->p->one->rename_used) { + int keep_deletion = 0; + + if (DIFF_PAIR_BROKEN(p)) { + struct diff_rename_dst *dst = + locate_rename_dst(p->one, 0); + /* If nobody swaps in other contents here... */ + if (!(dst && dst->pair)) + keep_deletion = 1; + } else { + /* It did not go anywhere? Then keep deletion */ + if (!src || !src->p->one->rename_used) + keep_deletion = 1; + } + + if (keep_deletion) { diff_q(&outq, p); q->queue[i] = NULL; } |