summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7fa68c)
raw | patch | inline | side by side (parent: a7fa68c)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 12 Jun 2005 03:55:20 +0000 (20:55 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 13 Jun 2005 03:40:19 +0000 (20:40 -0700) |
When rename/copy uses a file that was broken by diffcore-break
as the source, and the broken filepair gets merged back later,
the output was mislabeled as a rename. In this case, the source
file ends up staying in the output, so we should label it as a
copy instead.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
as the source, and the broken filepair gets merged back later,
the output was mislabeled as a rename. In this case, the source
file ends up staying in the output, so we should label it as a
copy instead.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff.c | patch | blob | history | |
diffcore-rename.c | patch | blob | history |
index dd1c0b6d55ded16509e8ea5f6cfd1ce5e770e22c..d6661f82684fac739513bd7fea710c98c8f80663 100644 (file)
--- a/diff.c
+++ b/diff.c
dp->one = one;
dp->two = two;
dp->score = 0;
+ dp->status = 0;
dp->source_stays = 0;
dp->broken_pair = 0;
diff_q(queue, dp);
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 19325f245c251b7a1bd6bd585eb05d7e3f51ca44..8fb45f0b8706baa6a1190b21d723d0b0d81203c5 100644 (file)
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
continue; /* unmerged */
else
locate_rename_dst(p->two, 1);
- else if (!DIFF_FILE_VALID(p->two))
- register_rename_src(p->one, 0);
+ else if (!DIFF_FILE_VALID(p->two)) {
+ /* If the source is a broken "delete", and
+ * they did not really want to get broken,
+ * that means the source actually stays.
+ */
+ int stays = (p->broken_pair && !p->score);
+ register_rename_src(p->one, stays);
+ }
else if (detect_rename == DIFF_DETECT_COPY)
register_rename_src(p->one, 1);
}