aboutsummaryrefslogtreecommitdiffstats
path: root/diff-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-28 16:42:27 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-28 16:42:27 -0700
commit40469ee9c6a6f4c85df5520ef719bba3d38a64f0 (patch)
treedc0b54b68c90574a689fef23c5ab26d165f3ee2e /diff-tree.c
parentcf9a113d3526c301b380fbd8a5d3b9d74d322c71 (diff)
downloadgit-40469ee9c6a6f4c85df5520ef719bba3d38a64f0.tar.gz
[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>
Diffstat (limited to 'diff-tree.c')
-rw-r--r--diff-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-tree.c b/diff-tree.c
index 5a1ad34652..e7a5b7cc76 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -238,10 +238,10 @@ static int diff_tree_sha1(const unsigned char *old, const unsigned char *new, co
unsigned long size1, size2;
int retval;
- tree1 = read_tree_with_tree_or_commit_sha1(old, &size1, 0);
+ tree1 = read_object_with_reference(old, "tree", &size1, 0);
if (!tree1)
die("unable to read source tree (%s)", sha1_to_hex(old));
- tree2 = read_tree_with_tree_or_commit_sha1(new, &size2, 0);
+ tree2 = read_object_with_reference(new, "tree", &size2, 0);
if (!tree2)
die("unable to read destination tree (%s)", sha1_to_hex(new));
retval = diff_tree(tree1, size1, tree2, size2, base);