summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 00:25:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-02 04:59:51 (GMT)
commitd8a92ced62f758fedad95a192978b910b1cc498a (patch)
tree86f77771deecf03d6ba6e14f13fada96e1a66b5e /cache.h
parentf6d27d2468ccf8e123f9bffde6466d673dba2317 (diff)
downloadgit-d8a92ced62f758fedad95a192978b910b1cc498a.zip
git-d8a92ced62f758fedad95a192978b910b1cc498a.tar.gz
git-d8a92ced62f758fedad95a192978b910b1cc498a.tar.bz2
sha1-file: add functions for hex empty tree and blob OIDs
Oftentimes, we'll want to refer to an empty tree or empty blob by its hex name without having to call oid_to_hex or explicitly refer to the_hash_algo. Add helper functions that format these values into static buffers and return them for easy use. 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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 9ad1dd2..14690c8 100644
--- a/cache.h
+++ b/cache.h
@@ -1049,6 +1049,9 @@ static inline int is_empty_tree_oid(const struct object_id *oid)
return !oidcmp(oid, the_hash_algo->empty_tree);
}
+const char *empty_tree_oid_hex(void);
+const char *empty_blob_oid_hex(void);
+
/* set default permissions by passing mode arguments to open(2) */
int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
int git_mkstemp_mode(char *pattern, int mode);