diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-01-29 13:18:55 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-29 13:18:55 -0800 |
commit | 86e15ff4fe9924b73af32d1bebe77eb5592b93cd (patch) | |
tree | 4f8f2fe9aa3a3461e29e04c440394f5777b0b5a4 /xdiff/xemit.c | |
parent | d1afa8baa271fe0df1a15a6800f23f972abc5293 (diff) | |
parent | baf5aaa33383af656a34b7ba9039e9eb3c9e678c (diff) | |
download | git-86e15ff4fe9924b73af32d1bebe77eb5592b93cd.tar.gz |
Merge branch 'rs/diff-postimage-in-context'
* rs/diff-postimage-in-context:
xdiff: print post-image for common records instead of pre-image
Diffstat (limited to 'xdiff/xemit.c')
-rw-r--r-- | xdiff/xemit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xdiff/xemit.c b/xdiff/xemit.c index 2e669c3e25..d11dbf9f13 100644 --- a/xdiff/xemit.c +++ b/xdiff/xemit.c @@ -87,7 +87,7 @@ static long def_ff(const char *rec, long len, char *buf, long sz, void *priv) static int xdl_emit_common(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, xdemitconf_t const *xecfg) { - xdfile_t *xdf = &xe->xdf1; + xdfile_t *xdf = &xe->xdf2; const char *rchg = xdf->rchg; long ix; @@ -204,8 +204,8 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, /* * Emit pre-context. */ - for (; s1 < xch->i1; s1++) - if (xdl_emit_record(&xe->xdf1, s1, " ", ecb) < 0) + for (; s2 < xch->i2; s2++) + if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0) return -1; for (s1 = xch->i1, s2 = xch->i2;; xch = xch->next) { @@ -213,7 +213,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, * Merge previous with current change atom. */ for (; s1 < xch->i1 && s2 < xch->i2; s1++, s2++) - if (xdl_emit_record(&xe->xdf1, s1, " ", ecb) < 0) + if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0) return -1; /* @@ -239,8 +239,8 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, /* * Emit post-context. */ - for (s1 = xche->i1 + xche->chg1; s1 < e1; s1++) - if (xdl_emit_record(&xe->xdf1, s1, " ", ecb) < 0) + for (s2 = xche->i2 + xche->chg2; s2 < e2; s2++) + if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0) return -1; } |