Code

xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
[git.git] / convert-objects.c
index 4e7ff7517f40f5dd5c23cd3fd6a42d3cb621aec1..631678b08a7cb83b0349f1a683d3cd7fb797fb7a 100644 (file)
@@ -23,7 +23,7 @@ static struct entry * convert_entry(unsigned char *sha1);
 static struct entry *insert_new(unsigned char *sha1, int pos)
 {
        struct entry *new = xcalloc(1, sizeof(struct entry));
-       memcpy(new->old_sha1, sha1, 20);
+       hashcpy(new->old_sha1, sha1);
        memmove(convert + pos + 1, convert + pos, (nr_convert - pos) * sizeof(struct entry *));
        convert[pos] = new;
        nr_convert++;
@@ -54,7 +54,7 @@ static struct entry *lookup_entry(unsigned char *sha1)
 static void convert_binary_sha1(void *buffer)
 {
        struct entry *entry = convert_entry(buffer);
-       memcpy(buffer, entry->new_sha1, 20);
+       hashcpy(buffer, entry->new_sha1);
 }
 
 static void convert_ascii_sha1(void *buffer)
@@ -104,7 +104,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base
                if (!slash) {
                        newlen += sprintf(new + newlen, "%o %s", mode, path);
                        new[newlen++] = '\0';
-                       memcpy(new + newlen, (char *) buffer + len - 20, 20);
+                       hashcpy((unsigned char*)new + newlen, (unsigned char *) buffer + len - 20);
                        newlen += 20;
 
                        used += len;