diff options
author | Jeff King <peff@peff.net> | 2010-04-01 20:05:23 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-04-01 23:53:54 -0700 |
commit | 40d52ff77b093fa48f58a168f4b0c4e65b862e56 (patch) | |
tree | 6b425dfbcbdbe478604dadba8667e39d751f0ee3 /cache.h | |
parent | b76c056b95ccb15ae3b0723da983914de88b4bae (diff) | |
download | git-40d52ff77b093fa48f58a168f4b0c4e65b862e56.tar.gz git-40d52ff77b093fa48f58a168f4b0c4e65b862e56.tar.xz |
make commit_tree a library function
Until now, this has been part of the commit-tree builtin.
However, it is already used by other builtins (like commit,
merge, and notes), and it would be useful to access it from
library code.
The check_valid helper has to come along, too, but is given
a more library-ish name of "assert_sha1_type".
Otherwise, the code is unchanged. There are still a few
rough edges for a library function, like printing the utf8
warning to stderr, but we can address those if and when they
come up as inappropriate.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -718,6 +718,8 @@ extern int has_loose_object_nonlocal(const unsigned char *sha1); extern int has_pack_index(const unsigned char *sha1); +extern void assert_sha1_type(const unsigned char *sha1, enum object_type expect); + extern const signed char hexval_table[256]; static inline unsigned int hexval(unsigned char c) { |