Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
define empty tree sha1 as a macro
author
Jeff King
<peff@peff.net>
Wed, 12 Nov 2008 08:17:52 +0000
(
03:17
-0500)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 12 Nov 2008 20:52:21 +0000
(12:52 -0800)
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>
cache.h
patch
|
blob
|
history
sha1_file.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2baf185
)
diff --git
a/cache.h
b/cache.h
index eda7028992421e3946d93179a0dd6539f43967bb..07795d9a816a9f17db2c19a6be8597d9ee1cd6f6 100644
(file)
--- a/
cache.h
+++ b/
cache.h
@@
-528,6
+528,12
@@
static inline void hashclr(unsigned char *hash)
}
extern int is_empty_blob_sha1(const unsigned char *sha1);
}
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);
/*
int git_mkstemp(char *path, size_t n, const char *template);
/*
diff --git
a/sha1_file.c
b/sha1_file.c
index ab2b520f033c75e5e8d3434376a203add59559a4..1489d04d032d2890a6d54dc4e9d2ad926b8636cc 100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-1996,9
+1996,7
@@
static struct cached_object {
static int cached_object_nr, cached_object_alloc;
static struct cached_object empty_tree = {
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
OBJ_TREE,
"",
0