format-patch: add '--base' option to record base tree info
[gitweb.git] / patch-ids.c
index bf81b923610fe2473655560cd111adb3061673d9..a4d00166646d3dc354f3c06e9e75ce7dc3724f6a 100644 (file)
@@ -4,14 +4,14 @@
 #include "sha1-lookup.h"
 #include "patch-ids.h"
 
-static int commit_patch_id(struct commit *commit, struct diff_options *options,
+int commit_patch_id(struct commit *commit, struct diff_options *options,
                    unsigned char *sha1)
 {
        if (commit->parents)
-               diff_tree_sha1(commit->parents->item->object.sha1,
-                              commit->object.sha1, "", options);
+               diff_tree_sha1(commit->parents->item->object.oid.hash,
+                              commit->object.oid.hash, "", options);
        else
-               diff_root_tree_sha1(commit->object.sha1, "", options);
+               diff_root_tree_sha1(commit->object.oid.hash, "", options);
        diffcore_std(options);
        return diff_flush_patch_id(options, sha1);
 }