object: introduce get_object_hash macro.

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>

brian m. carlson committed Nov 10, 2015 at 02:22 UTC 3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28
1 file changed +2
object.h
+2
@@ -52,6 +52,8 @@ struct object {
52 unsigned char sha1[20];
53 };
54
55 +#define get_object_hash(x) ((x).sha1)
56 +
57 extern const char *typename(unsigned int type);
58 extern int type_from_string_gently(const char *str, ssize_t, int gentle);
59 #define type_from_string(str) type_from_string_gently(str, -1, 0)