summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e923eae)
raw | patch | inline | side by side (parent: e923eae)
author | Björn Gustavsson <bgustavsson@gmail.com> | |
Sat, 6 Mar 2010 14:30:21 +0000 (15:30 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 7 Mar 2010 07:53:00 +0000 (23:53 -0800) |
In match_fragment(), the line lengths in the preimage are updated
just before calling update_pre_post_images(). That is not
necessary, since update_pre_post_images() itself will
update the line lengths based on the buffer passed to it.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
just before calling update_pre_post_images(). That is not
necessary, since update_pre_post_images() itself will
update the line lengths based on the buffer passed to it.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c | patch | blob | history |
diff --git a/builtin-apply.c b/builtin-apply.c
index 2a1004d025fcfdea4d317ef3236ff6bc76e3e65a..fc6c7083f76043168bf8024a9fa50b7f767b99bc 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
}
/*
- * Ok, the preimage matches with whitespace fuzz. Update it and
- * the common postimage lines to use the same whitespace as the
- * target. imgoff now holds the true length of the target that
- * matches the preimage, and we need to update the line lengths
- * of the preimage to match the target ones.
+ * Ok, the preimage matches with whitespace fuzz.
+ *
+ * imgoff now holds the true length of the target that
+ * matches the preimage. Update the preimage and
+ * the common postimage context lines to use the same
+ * whitespace as the target.
*/
fixed_buf = xmalloc(imgoff);
memcpy(fixed_buf, img->buf + try, imgoff);
- for (i = 0; i < preimage->nr; i++)
- preimage->line[i].len = img->line[try_lno+i].len;
-
- /*
- * Update the preimage buffer and the postimage context lines.
- */
update_pre_post_images(preimage, postimage,
fixed_buf, imgoff, postlen);
return 1;