Skip to content

Commit

Permalink
sha1_file.c: introduce a null_oid constant
Browse files Browse the repository at this point in the history
null_oid is the struct object_id equivalent to null_sha1.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
brian m. carlson authored and Junio C Hamano committed Dec 14, 2015
1 parent fcd30b1 commit 3e56e72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ extern const char *find_unique_abbrev(const unsigned char *sha1, int len);
extern int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len);

extern const unsigned char null_sha1[GIT_SHA1_RAWSZ];
extern const struct object_id null_oid;

static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
{
Expand Down
1 change: 1 addition & 0 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
static inline uintmax_t sz_fmt(size_t s) { return s; }

const unsigned char null_sha1[20];
const struct object_id null_oid;

/*
* This is meant to hold a *small* number of objects that you would
Expand Down

0 comments on commit 3e56e72

Please sign in to comment.