| author | Jonathan Nieder <jrnieder@gmail.com> | |
| Mon, 7 Feb 2011 08:17:27 +0000 (02:17 -0600) | ||
| committer | Junio C Hamano <gitster@pobox.com> | |
| Mon, 14 Feb 2011 18:48:06 +0000 (10:48 -0800) | ||
| commit | dab0d4108d7b45905a12ec6cea2cfc20ea8eabef | |
| tree | cbb40a68ba305bc554aba9a8349fa2749727f4dc | tree | snapshot |
| parent | 9971d6d52c5afeb8ba60ae6ddcffb34af23eeadd | commit | diff |
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>
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>
| builtin/checkout.c | diff | blob | history | |
| cache.h | diff | blob | history | |
| notes-merge.c | diff | blob | history | |
| sha1_file.c | diff | blob | history |