define empty tree sha1 as a macro

This can potentially be used in a few places, so let's make
it available to all parts of the code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2008-11-12 03:17:52 -05:00 коммит произвёл Junio C Hamano
Родитель 2baf1850ce
Коммит 14d9c57896
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -528,6 +528,12 @@ static inline void hashclr(unsigned char *hash)
}
extern int is_empty_blob_sha1(const unsigned char *sha1);
#define EMPTY_TREE_SHA1_HEX \
"4b825dc642cb6eb9a060e54bf8d69288fbee4904"
#define EMPTY_TREE_SHA1_BIN \
"\x4b\x82\x5d\xc6\x42\xcb\x6e\xb9\xa0\x60" \
"\xe5\x4b\xf8\xd6\x92\x88\xfb\xee\x49\x04"
int git_mkstemp(char *path, size_t n, const char *template);
/*

Просмотреть файл

@ -1996,9 +1996,7 @@ static struct cached_object {
static int cached_object_nr, cached_object_alloc;
static struct cached_object empty_tree = {
/* empty tree sha1: 4b825dc642cb6eb9a060e54bf8d69288fbee4904 */
"\x4b\x82\x5d\xc6\x42\xcb\x6e\xb9\xa0\x60"
"\xe5\x4b\xf8\xd6\x92\x88\xfb\xee\x49\x04",
EMPTY_TREE_SHA1_BIN,
OBJ_TREE,
"",
0