summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-02 15:56:46 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-02 15:56:46 -0700
commitedc7f0abcbc42d05a5be1877ded9cc6eba5ec1b6 (patch)
tree40bd9da3afb64753b3a6b6ad8a716f129eb72514 /combine-diff.c
parent911439a5aba362add6b672a09afd11706e05aed7 (diff)
parentaac385717a62bfa6889151d191e08b9725587912 (diff)
downloadgit-edc7f0abcbc42d05a5be1877ded9cc6eba5ec1b6.tar.gz
Merge branch 'mk/combine-diff-context-horizon-fix'
"git diff -c -p" was not showing a deleted line from a hunk when another hunk immediately begins where the earlier one ends. * mk/combine-diff-context-horizon-fix: combine-diff.c: Fix output when changes are exactly 3 lines apart
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 77d7872aaf..3e8bb17831 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -518,8 +518,11 @@ static int give_context(struct sline *sline, unsigned long cnt, int num_parent)
unsigned long k;
/* Paint a few lines before the first interesting line. */
- while (j < i)
- sline[j++].flag |= mark | no_pre_delete;
+ while (j < i) {
+ if (!(sline[j].flag & mark))
+ sline[j].flag |= no_pre_delete;
+ sline[j++].flag |= mark;
+ }
again:
/* we know up to i is to be included. where does the