diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-02-27 14:01:38 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-27 14:01:39 -0800 |
commit | 795dd116bb655f8aa8c206ecaf415527871cb7a6 (patch) | |
tree | 678a43749175cc91a5177fc0dace6c5a6c91a36c /revision.c | |
parent | 8a342058f62d24d6ff62a0f6e81d3e60291eae94 (diff) | |
parent | 7146e66f0861c720f9b32dc9d80ab80495a33e43 (diff) | |
download | git-795dd116bb655f8aa8c206ecaf415527871cb7a6.tar.gz |
Merge branch 'ks/tree-diff-walk'
* ks/tree-diff-walk:
tree-walk: finally switch over tree descriptors to contain a pre-parsed entry
revision: convert to using diff_tree_sha1()
line-log: convert to using diff_tree_sha1()
tree-diff: convert diff_root_tree_sha1() to just call diff_tree_sha1 with old=NULL
tree-diff: allow diff_tree_sha1 to accept NULL sha1
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/revision.c b/revision.c index f40ccf1426..61be08754a 100644 --- a/revision.c +++ b/revision.c @@ -497,24 +497,14 @@ static int rev_compare_tree(struct rev_info *revs, static int rev_same_tree_as_empty(struct rev_info *revs, struct commit *commit) { int retval; - void *tree; - unsigned long size; - struct tree_desc empty, real; struct tree *t1 = commit->tree; if (!t1) return 0; - tree = read_object_with_reference(t1->object.sha1, tree_type, &size, NULL); - if (!tree) - return 0; - init_tree_desc(&real, tree, size); - init_tree_desc(&empty, "", 0); - tree_difference = REV_TREE_SAME; DIFF_OPT_CLR(&revs->pruning, HAS_CHANGES); - retval = diff_tree(&empty, &real, "", &revs->pruning); - free(tree); + retval = diff_tree_sha1(NULL, t1->object.sha1, "", &revs->pruning); return retval >= 0 && (tree_difference == REV_TREE_SAME); } |