]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diffcore-rename.c
hashmap: factor out getting a hash code from a SHA1
[thirdparty/git.git] / diffcore-rename.c
index 749a35d2c2ab3271c6503a19271a5be6a6e97b4d..6fa97d44336d4f6250b94e5c20de56b9c51bb66e 100644 (file)
@@ -242,14 +242,12 @@ struct file_similarity {
 
 static unsigned int hash_filespec(struct diff_filespec *filespec)
 {
-       unsigned int hash;
        if (!filespec->sha1_valid) {
                if (diff_populate_filespec(filespec, 0))
                        return 0;
                hash_sha1_file(filespec->data, filespec->size, "blob", filespec->sha1);
        }
-       memcpy(&hash, filespec->sha1, sizeof(hash));
-       return hash;
+       return sha1hash(filespec->sha1);
 }
 
 static int find_identical_files(struct hashmap *srcs,