[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 <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Junio C Hamano
2005-04-28 16:42:27 -07:00
committed by Linus Torvalds
parent cf9a113d35
commit 40469ee9c6
7 changed files with 46 additions and 40 deletions

View File

@ -180,7 +180,7 @@ int main(int argc, char **argv)
mark_merge_entries();
tree = read_tree_with_tree_or_commit_sha1(tree_sha1, &size, 0);
tree = read_object_with_reference(tree_sha1, "tree", &size, 0);
if (!tree)
die("bad tree object %s", argv[1]);
if (read_tree(tree, size, 1))