Skip to content

Commit 422af49

Browse files
stefanbellergitster
authored andcommitted
merge-recursive: fix copy-paste mistake
The following issue was found by scan.coverity.com (ID: 1049510), and claimed to be likely a copy-paste mistake. Introduced in 331a183 (2010-07-02, Try normalizing files to avoid delete/modify conflicts when merging), which is quite a long time ago, so I'm rather unsure if it's of any impact or just went unnoticed. The line after the changed line has a comparison of 'o.len' to 'a.len', so we should assume the lengths may be different. I'd be happy to have a test for this bug(?) attached to t6031-merge-recursive.sh, but I did not manage to come up with a test in a reasonable amount of time. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 331a183 commit 422af49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ static int blob_unchanged(const unsigned char *o_sha,
10941094
* unchanged since their sha1s have already been compared.
10951095
*/
10961096
if (renormalize_buffer(path, o.buf, o.len, &o) |
1097-
renormalize_buffer(path, a.buf, o.len, &a))
1097+
renormalize_buffer(path, a.buf, a.len, &a))
10981098
ret = (o.len == a.len && !memcmp(o.buf, a.buf, o.len));
10991099

11001100
error_return:

0 commit comments

Comments
 (0)