Skip to content

Commit

Permalink
object: introduce get_object_hash macro.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jeff King <[email protected]>
  • Loading branch information
bk2204 authored and peff committed Nov 20, 2015
1 parent 6f3d57b commit 3c42701
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions object.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3c42701

Please sign in to comment.