Code

apply --whitespace=fix: fix handling of blank lines at the eof
[git.git] / builtin-apply.c
index 7a1ff041f15cd4e6ce2a5b1d1e3cb668f2f54f5e..5b5bde4f39e9c438a108fa1be0d04c76a379b696 100644 (file)
@@ -2069,7 +2069,7 @@ static int apply_one_fragment(struct image *img, struct fragment *frag,
        if (applied_pos >= 0) {
                if (ws_error_action == correct_ws_error &&
                    new_blank_lines_at_end &&
-                   postimage.nr + applied_pos == img->nr) {
+                   preimage.nr + applied_pos == img->nr) {
                        /*
                         * If the patch application adds blank lines
                         * at the end, and if the patch applies at the