From 86bbe822114c01d9c1bcfe6950463ee1c73e39a5 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 27 Apr 2016 16:39:48 +0200 Subject: [PATCH] fix: link to line in hunk if a patch has multiple files and hunks thanks to lostd for reporting it! --- stagit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stagit.c b/stagit.c index 638e58c..e3c921d 100644 --- a/stagit.c +++ b/stagit.c @@ -394,7 +394,7 @@ printshowfile(FILE *fp, struct commitinfo *ci) if (git_patch_get_hunk(&hunk, &nhunklines, patch, j)) break; - fprintf(fp, "", j, j); + fprintf(fp, "", i, j, i, j); xmlencode(fp, hunk->header, hunk->header_len); fputs("", fp); @@ -402,11 +402,11 @@ printshowfile(FILE *fp, struct commitinfo *ci) if (git_patch_get_line_in_hunk(&line, patch, j, k)) break; if (line->old_lineno == -1) - fprintf(fp, "+", - j, k, j, k); + fprintf(fp, "+", + i, j, k, i, j, k); else if (line->new_lineno == -1) - fprintf(fp, "-", - j, k, j, k); + fprintf(fp, "-", + i, j, k, i, j, k); else fputc(' ', fp); xmlencode(fp, line->content, line->content_len);