summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-02-07 08:17:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-02-14 18:48:06 (GMT)
commitdab0d4108d7b45905a12ec6cea2cfc20ea8eabef (patch)
treecbb40a68ba305bc554aba9a8349fa2749727f4dc /builtin/checkout.c
parent9971d6d52c5afeb8ba60ae6ddcffb34af23eeadd (diff)
downloadgit-dab0d4108d7b45905a12ec6cea2cfc20ea8eabef.zip
git-dab0d4108d7b45905a12ec6cea2cfc20ea8eabef.tar.gz
git-dab0d4108d7b45905a12ec6cea2cfc20ea8eabef.tar.bz2
correct type of EMPTY_TREE_SHA1_BIN
Functions such as hashcmp that expect a binary SHA-1 value take parameters of type "unsigned char *" to avoid accepting a textual SHA-1 passed by mistake. Unfortunately, this means passing the string literal EMPTY_TREE_SHA1_BIN requires an ugly cast. Tweak the definition of EMPTY_TREE_SHA1_BIN to produce a value of more convenient type. In the future the definition might change to extern const unsigned char empty_tree_sha1_bin[20]; #define EMPTY_TREE_SHA1_BIN empty_tree_sha1_bin Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 757f9a0..cd7f56e 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -404,7 +404,7 @@ static int merge_working_tree(struct checkout_opts *opts,
topts.dir->exclude_per_dir = ".gitignore";
tree = parse_tree_indirect(old->commit ?
old->commit->object.sha1 :
- (unsigned char *)EMPTY_TREE_SHA1_BIN);
+ EMPTY_TREE_SHA1_BIN);
init_tree_desc(&trees[0], tree->buffer, tree->size);
tree = parse_tree_indirect(new->commit->object.sha1);
init_tree_desc(&trees[1], tree->buffer, tree->size);