hashcpy/hashcmp remaining bits.
This fixes up merge-recursive.c for hashcpy/hashcmp changes. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Aug 23, 2006 at 14:31 UTC
87cb004e4251722ca7b888f8b6c77335acb71a85
1 file changed
+4
-6
merge-recursive.c
+4
-6
@@ -56,7 +56,7 @@ static int sha_eq(const unsigned char *a, const unsigned char *b)
56
{
57
if (!a && !b)
58
return 2;
59
- return a && b && memcmp(a, b, 20) == 0;
59
+ return a && b && hashcmp(a, b) == 0;
60
}
61
62
/*
@@ -891,11 +891,9 @@ static int process_renames(struct path_list *a_renames,
891
892
remove_file(1, ren1_src);
893
894
- memcpy(src_other.sha1,
895
- ren1->src_entry->stages[stage].sha, 20);
894
+ hashcpy(src_other.sha1, ren1->src_entry->stages[stage].sha);
895
src_other.mode = ren1->src_entry->stages[stage].mode;
897
- memcpy(dst_other.sha1,
898
- ren1->dst_entry->stages[stage].sha, 20);
896
+ hashcpy(dst_other.sha1, ren1->dst_entry->stages[stage].sha);
897
dst_other.mode = ren1->dst_entry->stages[stage].mode;
898
899
try_merge = 0;
@@ -980,7 +978,7 @@ static int process_renames(struct path_list *a_renames,
978
979
static unsigned char *has_sha(const unsigned char *sha)
980
{
983
- return memcmp(sha, null_sha1, 20) == 0 ? NULL: (unsigned char *)sha;
981
+ return is_null_sha1(sha) ? NULL: (unsigned char *)sha;
982
}
983
984
/* Per entry merge function */