aboutsummaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:26 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commit3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (patch)
tree84fb375dbe65874be0a31fe0475cb1cd9dc8d146 /object.h
parent6f3d57b6e43d6c6f13c94371f16b79fcdece25bc (diff)
downloadgit-3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28.tar.gz
git-3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28.tar.xz
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>
Diffstat (limited to 'object.h')
-rw-r--r--object.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/object.h b/object.h
index 6416247de..7c098d031 100644
--- 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)