]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object: introduce get_object_hash macro.
authorbrian m. carlson <sandals@crustytoothpaste.net>
Tue, 10 Nov 2015 02:22:26 +0000 (02:22 +0000)
committerJeff King <peff@peff.net>
Fri, 20 Nov 2015 13:02:05 +0000 (08:02 -0500)
This macro is a temporary change to ease the transition of struct object
to use struct object_id.  It takes an argument of struct object and
returns the object's hash.  Provide this hash next to struct object for
easier conversion.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
object.h

index 6416247defa133c5c7ca43c69dfe09ae00ac03f7..7c098d031e1be90f64053e9238f4bc417b597b5d 100644 (file)
--- a/object.h
+++ b/object.h
@@ -52,6 +52,8 @@ struct object {
        unsigned char sha1[20];
 };
 
+#define get_object_hash(x) ((x).sha1)
+
 extern const char *typename(unsigned int type);
 extern int type_from_string_gently(const char *str, ssize_t, int gentle);
 #define type_from_string(str) type_from_string_gently(str, -1, 0)