apply: update line lengths for --inaccurate-eof
[git/git.git] / apply.c
diff --git a/apply.c b/apply.c
index 0e2caea..e0ad05b 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -2941,6 +2941,8 @@ static int apply_one_fragment(struct apply_state *state,
            newlines.len > 0 && newlines.buf[newlines.len - 1] == '\n') {
                old--;
                strbuf_setlen(&newlines, newlines.len - 1);
+               preimage.line_allocated[preimage.nr - 1].len--;
+               postimage.line_allocated[postimage.nr - 1].len--;
        }
 
        leading = frag->leading;