summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-09-24 10:30:48 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-09-24 10:30:48 -0700
commitdda26650bf03ba7291dc3ff8f1639bead00493f3 (patch)
treef94c9de3b16d6b7879e5e518e50e975ae8b965df
parentMerge branch 'en/rerere-multi-stage-1-fix' (diff)
parentdiff: fix --color-moved-ws=allow-indentation-change (diff)
downloadtgif-dda26650bf03ba7291dc3ff8f1639bead00493f3.tar.xz
Merge branch 'sb/diff-color-move-more'
Bugfix. * sb/diff-color-move-more: diff: fix --color-moved-ws=allow-indentation-change
-rw-r--r--diff.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index 71ff247702..f0c7557b40 100644
--- a/diff.c
+++ b/diff.c
@@ -980,8 +980,13 @@ static void pmb_advance_or_null_multi_match(struct diff_options *o,
/* Carry the white space delta forward */
pmb[i]->next_line->wsd = pmb[i]->wsd;
pmb[i] = pmb[i]->next_line;
- } else
+ } else {
+ if (pmb[i]->wsd) {
+ free(pmb[i]->wsd->string);
+ FREE_AND_NULL(pmb[i]->wsd);
+ }
pmb[i] = NULL;
+ }
}
}
@@ -1002,10 +1007,6 @@ static int shrink_potential_moved_blocks(struct moved_entry **pmb,
if (lp < pmb_nr && rp > -1 && lp < rp) {
pmb[lp] = pmb[rp];
- if (pmb[rp]->wsd) {
- free(pmb[rp]->wsd->string);
- FREE_AND_NULL(pmb[rp]->wsd);
- }
pmb[rp] = NULL;
rp--;
lp++;