summaryrefslogtreecommitdiff
path: root/builtin-apply.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2006-08-15 20:37:19 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-08-15 22:06:03 (GMT)
commit0bef57ee44a2f924ad0066b751a3c87888633f56 (patch)
tree6ef7a0dacc219c10994f48944e159598e916f88e /builtin-apply.c
parent3cd4f5e8eb04ae01298ceaf46bb41a4277031916 (diff)
downloadgit-0bef57ee44a2f924ad0066b751a3c87888633f56.zip
git-0bef57ee44a2f924ad0066b751a3c87888633f56.tar.gz
git-0bef57ee44a2f924ad0066b751a3c87888633f56.tar.bz2
make inline is_null_sha1 global
Replace sha1 comparisons to null_sha1 with a global inline (which previously an unused static inline in builtin-apply.c) [jc: with a fix from Jonas Fonseca.] Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r--builtin-apply.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index 4573c9a..1c1d16f 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -1684,7 +1684,7 @@ static int apply_binary(struct buffer_desc *desc, struct patch *patch)
}
get_sha1_hex(patch->new_sha1_prefix, sha1);
- if (!memcmp(sha1, null_sha1, 20)) {
+ if (is_null_sha1(sha1)) {
free(desc->buffer);
desc->alloc = desc->size = 0;
desc->buffer = NULL;
@@ -1916,11 +1916,6 @@ static int check_patch_list(struct patch *patch)
return error;
}
-static inline int is_null_sha1(const unsigned char *sha1)
-{
- return !memcmp(sha1, null_sha1, 20);
-}
-
static void show_index_list(struct patch *list)
{
struct patch *patch;