Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix %(lineno) computation for hunk postimages that span only one line
Usually diff hunk headers look like "@@ -a,b +c,d @@" where "a" is the starting line number and "b" is the number of lines in the preimage of the hunk. Same for "c" and "d" except they refer to lines in the postimage. Git omits "b" and "d" if they are 1. Tig already treated "b" as optional but not "d". We can simply ignore a missing number because "header->new.lines" is already initialized to 1 in parse_chunk_header(). $ echo old line 1 >? old $ echo new line 1 >? new $ git diff --no-index old new | tail -n3 @@ -1 +1 @@ -old line 1 +new line 1
- Loading branch information