From dab0d4108d7b45905a12ec6cea2cfc20ea8eabef Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 7 Feb 2011 02:17:27 -0600 Subject: 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 Signed-off-by: Junio C Hamano --- notes-merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'notes-merge.c') diff --git a/notes-merge.c b/notes-merge.c index 71c4d45fc..1467ad317 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -615,7 +615,7 @@ int notes_merge(struct notes_merge_options *o, bases = get_merge_bases(local, remote, 1); if (!bases) { base_sha1 = null_sha1; - base_tree_sha1 = (unsigned char *)EMPTY_TREE_SHA1_BIN; + base_tree_sha1 = EMPTY_TREE_SHA1_BIN; OUTPUT(o, 4, "No merge base found; doing history-less merge"); } else if (!bases->next) { base_sha1 = bases->item->object.sha1; -- cgit v1.2.1