diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-03-22 15:07:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-03-22 15:08:35 -0700 |
commit | d5b592cf6799e3e9d80150c62af6033ba2c32a5a (patch) | |
tree | fa4d66df71d618a223f526fe2c85835e4c2cb8ab /cache.h | |
parent | 498a04af143f55a7bbbba484d48a7f123d43be04 (diff) | |
parent | 536caca5ce0d88e4c54e9e7376ed182807702c58 (diff) | |
download | git-jk/merge-recursive-no-rename-empty.tar.gz |
Adjust 'jk/maint-1.7.7-merge-recursive-no-rename-empty' for the 1.7.10 codebasejk/merge-recursive-no-rename-empty
A new offender that casts EMPTY_TREE_SHA1_BIN was added to sequencer.c
after 1.7.9.x maintenance track; adjust the "merge-recursive" series
applied for older maintenance track to the current codebase.
* jk/maint-1.7.7-merge-recursive-no-rename-empty:
merge-recursive: don't detect renames from empty files
make is_empty_blob_sha1 available everywhere
drop casts from users EMPTY_TREE_SHA1_BIN
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -708,6 +708,19 @@ static inline void hashclr(unsigned char *hash) #define EMPTY_TREE_SHA1_BIN \ ((const unsigned char *) EMPTY_TREE_SHA1_BIN_LITERAL) +#define EMPTY_BLOB_SHA1_HEX \ + "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391" +#define EMPTY_BLOB_SHA1_BIN_LITERAL \ + "\xe6\x9d\xe2\x9b\xb2\xd1\xd6\x43\x4b\x8b" \ + "\x29\xae\x77\x5a\xd8\xc2\xe4\x8c\x53\x91" +#define EMPTY_BLOB_SHA1_BIN \ + ((const unsigned char *) EMPTY_BLOB_SHA1_BIN_LITERAL) + +static inline int is_empty_blob_sha1(const unsigned char *sha1) +{ + return !hashcmp(sha1, EMPTY_BLOB_SHA1_BIN); +} + int git_mkstemp(char *path, size_t n, const char *template); int git_mkstemps(char *path, size_t n, const char *template, int suffix_len); |