summaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-02 15:58:27 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-02 15:58:27 -0700
commit2db8926236406a4e4cb17d1b9c4b791706fb0512 (patch)
tree2156bd237ac11f679bbc3bb9e085cae81d12e441 /diffcore-rename.c
parent791a765e54b9b4c8d2cf4f069222e31cef8aa24e (diff)
parentd7c9bf22351e39756f93f09b4251a6b5861d9cc0 (diff)
downloadgit-2db8926236406a4e4cb17d1b9c4b791706fb0512.tar.gz
Merge branch 'mz/maint-rename-unmerged'
* mz/maint-rename-unmerged: diffcore-rename: don't consider unmerged path as source
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 3d65bb370d..f639601c76 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -515,7 +515,7 @@ void diffcore_rename(struct diff_options *options)
else
locate_rename_dst(p->two, 1);
}
- else if (!DIFF_FILE_VALID(p->two)) {
+ else if (!DIFF_PAIR_UNMERGED(p) && !DIFF_FILE_VALID(p->two)) {
/*
* If the source is a broken "delete", and
* they did not really want to get broken,
@@ -631,7 +631,10 @@ void diffcore_rename(struct diff_options *options)
struct diff_filepair *p = q->queue[i];
struct diff_filepair *pair_to_free = NULL;
- if (!DIFF_FILE_VALID(p->one) && DIFF_FILE_VALID(p->two)) {
+ if (DIFF_PAIR_UNMERGED(p)) {
+ diff_q(&outq, p);
+ }
+ else if (!DIFF_FILE_VALID(p->one) && DIFF_FILE_VALID(p->two)) {
/*
* Creation
*