From 40469ee9c6a6f4c85df5520ef719bba3d38a64f0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 28 Apr 2005 16:42:27 -0700 Subject: [PATCH] Rename and extend read_tree_with_tree_or_commit_sha1 This patch renames read_tree_with_tree_or_commit_sha1() to read_object_with_reference() and extends it to automatically dereference not just "commit" objects but "tag" objects. With this patch, you can say e.g.: ls-tree $tag read-tree -m $(merge-base $tag $HEAD) $tag $HEAD diff-cache $tag diff-tree $tag $HEAD Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- cache.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 3277d4870..aca98f3ec 100644 --- a/cache.h +++ b/cache.h @@ -143,9 +143,10 @@ extern int error(const char *err, ...); extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2); -extern void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1, - unsigned long *size, - unsigned char *tree_sha1_ret); +extern void *read_object_with_reference(const unsigned char *sha1, + const unsigned char *required_type, + unsigned long *size, + unsigned char *sha1_ret); static inline void *xmalloc(int size) { -- cgit v1.2.1