summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-30 07:08:07 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-30 17:35:49 (GMT)
commit2cd68882ee8629f9782be017007fff4c78e45e45 (patch)
tree8a0c8a7ec9671d06cb33bb4d91596ddb9877b961 /diff.c
parent9d429ff6ff2832d6e63933e6d33b8380be703017 (diff)
downloadgit-2cd68882ee8629f9782be017007fff4c78e45e45.zip
git-2cd68882ee8629f9782be017007fff4c78e45e45.tar.gz
git-2cd68882ee8629f9782be017007fff4c78e45e45.tar.bz2
[PATCH] diff: fix the culling of unneeded delete record.
The commit 15d061b435a7e3b6bead39df3889f4af78c4b00a [PATCH] Fix the way diffcore-rename records unremoved source. still leaves unneeded delete records in its output stream by mistake, which was covered up by having an extra check to turn such a delete into a no-op downstream. Fix the check in the diffcore-rename to simplify the output routine. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/diff.c b/diff.c
index 919280d..a080d94 100644
--- a/diff.c
+++ b/diff.c
@@ -792,27 +792,8 @@ static void diff_resolve_rename_copy(void)
p->status = 'U';
else if (!DIFF_FILE_VALID(p->one))
p->status = 'N';
- else if (!DIFF_FILE_VALID(p->two)) {
- /* Deleted entry may have been picked up by
- * another rename-copy entry. So we scan the
- * queue and if we find one that uses us as the
- * source we do not say delete for this entry.
- */
- for (j = 0; j < q->nr; j++) {
- pp = q->queue[j];
- if (!strcmp(p->one->path, pp->one->path) &&
- DIFF_PAIR_RENAME(pp)) {
- /* rename/copy are always valid
- * so we do not say DIFF_FILE_VALID()
- * on pp->one and pp->two.
- */
- p->status = 'X';
- break;
- }
- }
- if (!p->status)
- p->status = 'D';
- }
+ else if (!DIFF_FILE_VALID(p->two))
+ p->status = 'D';
else if (DIFF_PAIR_TYPE_CHANGED(p))
p->status = 'T';