diff options
| author | Vicent Martà <vicent@github.com> | 2013-05-07 08:00:44 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2013-05-07 08:00:44 -0700 |
| commit | 33665410d636c9f5f0d5e017fe6347260b1b6ec1 (patch) | |
| tree | cbed3fdf12eb76d2cef7e199d85c457e62e79b70 /src/diff_output.c | |
| parent | 1c92f1090ed49d5d15f0ba057067114234e624c4 (diff) | |
| parent | c2f602f8a5265a4be6383127435a18a8be98c9fe (diff) | |
| download | libgit2-33665410d636c9f5f0d5e017fe6347260b1b6ec1.tar.gz | |
Merge pull request #1556 from arrbee/diff-patch-fixes
Diff patch bug fixes
Diffstat (limited to 'src/diff_output.c')
| -rw-r--r-- | src/diff_output.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/diff_output.c b/src/diff_output.c index bac8622c8..2214ae1b5 100644 --- a/src/diff_output.c +++ b/src/diff_output.c @@ -726,7 +726,7 @@ static int diff_patch_cb(void *priv, mmbuffer_t *bufs, int len) char origin = (*bufs[0].ptr == '+') ? GIT_DIFF_LINE_DEL_EOFNL : (*bufs[0].ptr == '-') ? GIT_DIFF_LINE_ADD_EOFNL : - GIT_DIFF_LINE_CONTEXT; + GIT_DIFF_LINE_CONTEXT_EOFNL; if (ctxt->data_cb != NULL && ctxt->data_cb(patch->delta, &ctxt->range, @@ -930,11 +930,13 @@ static int diff_patch_line_cb( switch (line_origin) { case GIT_DIFF_LINE_ADDITION: + case GIT_DIFF_LINE_DEL_EOFNL: line->oldno = -1; line->newno = patch->newno; patch->newno += line->lines; break; case GIT_DIFF_LINE_DELETION: + case GIT_DIFF_LINE_ADD_EOFNL: line->oldno = patch->oldno; line->newno = -1; patch->oldno += line->lines; |
