diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-24 10:30:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-24 10:30:48 -0700 |
commit | dda26650bf03ba7291dc3ff8f1639bead00493f3 (patch) | |
tree | f94c9de3b16d6b7879e5e518e50e975ae8b965df | |
parent | Merge branch 'en/rerere-multi-stage-1-fix' (diff) | |
parent | diff: fix --color-moved-ws=allow-indentation-change (diff) | |
download | tgif-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.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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++; |