summaryrefslogtreecommitdiff
path: root/diffcore-break.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-01-07 12:44:41 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-01-07 12:44:42 -0800
commitf41157e649615ada01f175d00f9bd8c9ea507bca (patch)
tree0c6afd1da029f0ae2697954576058f7d2de53ca2 /diffcore-break.c
parentMerge branch 'jc/clone-borrow' (diff)
parentdiff -B -M: fix output for "copy and then rewrite" case (diff)
downloadtgif-f41157e649615ada01f175d00f9bd8c9ea507bca.tar.xz
Merge branch 'jc/diff-b-m'
Fix long-standing bug in "diff -B -M" output. * jc/diff-b-m: diff -B -M: fix output for "copy and then rewrite" case
Diffstat (limited to 'diffcore-break.c')
-rw-r--r--diffcore-break.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index 1d9e530a84..5473493e10 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -246,6 +246,13 @@ static void merge_broken(struct diff_filepair *p,
dp = diff_queue(outq, d->one, c->two);
dp->score = p->score;
+ /*
+ * We will be one extra user of the same src side of the
+ * broken pair, if it was used as the rename source for other
+ * paths elsewhere. Increment to mark that the path stays
+ * in the resulting tree.
+ */
+ d->one->rename_used++;
diff_free_filespec_data(d->two);
diff_free_filespec_data(c->one);
free(d);