summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:20 +0000
committerJunio C Hamano <gitster@pobox.com>2019-08-19 15:04:59 -0700
commit8d4d86b0f0a875e7916d7de083a88d7f11251406 (patch)
tree1b99e2d667ac3845e60f32e69862eed1a9b38ec6 /cache.h
parentf6ca67d673c66e5c3988a18c2ec56b7fef9a23b6 (diff)
downloadgit-8d4d86b0f0a875e7916d7de083a88d7f11251406.tar.gz
cache: remove null_sha1
All of the existing uses of null_sha1 can be converted into uses of null_oid, so do so. Remove null_sha1 and is_null_sha1, and define is_null_oid in terms of null_oid. This also has the additional benefit of removing several uses of sha1_to_hex. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/cache.h b/cache.h
index b1da1ab08f..79efd2168f 100644
--- a/cache.h
+++ b/cache.h
@@ -1029,7 +1029,6 @@ const char *repo_find_unique_abbrev(struct repository *r, const struct object_id
int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
#define find_unique_abbrev_r(hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len)
-extern const unsigned char null_sha1[GIT_MAX_RAWSZ];
extern const struct object_id null_oid;
static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
@@ -1064,14 +1063,9 @@ static inline int oideq(const struct object_id *oid1, const struct object_id *oi
return hasheq(oid1->hash, oid2->hash);
}
-static inline int is_null_sha1(const unsigned char *sha1)
-{
- return hasheq(sha1, null_sha1);
-}
-
static inline int is_null_oid(const struct object_id *oid)
{
- return hasheq(oid->hash, null_sha1);
+ return oideq(oid, &null_oid);
}
static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)