From: Junio C Hamano Date: Thu, 27 Feb 2014 22:01:38 +0000 (-0800) Subject: Merge branch 'ks/tree-diff-walk' X-Git-Tag: v2.0.0-rc0~154 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/795dd116bb655f8aa8c206ecaf415527871cb7a6?ds=inline;hp=-c 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 --- 795dd116bb655f8aa8c206ecaf415527871cb7a6 diff --combined revision.c index f40ccf1426,7f61ecde8c..61be08754a --- a/revision.c +++ b/revision.c @@@ -16,7 -16,6 +16,7 @@@ #include "line-log.h" #include "mailmap.h" #include "commit-slab.h" +#include "dir.h" volatile show_early_output_fn_t show_early_output; @@@ -497,24 -496,14 +497,14 @@@ static int rev_compare_tree(struct rev_ 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); } @@@ -1401,7 -1390,7 +1391,7 @@@ static void prepare_show_merge(struct r const struct cache_entry *ce = active_cache[i]; if (!ce_stage(ce)) continue; - if (ce_path_match(ce, &revs->prune_data)) { + if (ce_path_match(ce, &revs->prune_data, NULL)) { prune_num++; prune = xrealloc(prune, sizeof(*prune) * prune_num); prune[prune_num-2] = ce->name;