summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-07-14 22:59:37 -0400
committerEdward Thomson <ethomson@github.com>2016-07-24 15:49:19 -0400
commit531be3e8c6e8ec08db9798e7837a5abf933cc650 (patch)
treee1753b9e5f959db74f8e804bb0dfd0363941c1b0
parente02f567641e487c8abec80f98f05264644004ed6 (diff)
downloadlibgit2-531be3e8c6e8ec08db9798e7837a5abf933cc650.tar.gz
apply: compare preimage to image
Compare the preimage to the image; don't compare the preimage to itself.
-rw-r--r--src/apply.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/apply.c b/src/apply.c
index 876860754..e982ab682 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -97,7 +97,7 @@ static bool match_hunk(
git_diff_line *preimage_line = git_vector_get(&preimage->lines, i);
git_diff_line *image_line = git_vector_get(&image->lines, linenum + i);
- if (preimage_line->content_len != preimage_line->content_len ||
+ if (preimage_line->content_len != image_line->content_len ||
memcmp(preimage_line->content, image_line->content, image_line->content_len) != 0) {
match = 0;
break;