From: Junio C Hamano Date: Sun, 16 Oct 2011 03:46:36 +0000 (-0700) Subject: Merge branch 'jc/diff-index-unpack' into maint X-Git-Tag: v1.7.7.1~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fc26f57b847b86ba330ea543a6dfc86a10d4cce3;p=git.git Merge branch 'jc/diff-index-unpack' into maint * jc/diff-index-unpack: diff-index: pass pathspec down to unpack-trees machinery unpack-trees: allow pruning with pathspec traverse_trees(): allow pruning with pathspec --- fc26f57b847b86ba330ea543a6dfc86a10d4cce3 diff --cc diff-lib.c index f8454dd29,12760b422..ebe751e72 --- a/diff-lib.c +++ b/diff-lib.c @@@ -468,17 -463,10 +468,18 @@@ static int diff_cache(struct rev_info * opts.unpack_data = revs; opts.src_index = &the_index; opts.dst_index = NULL; + opts.pathspec = &revs->diffopt.pathspec; init_tree_desc(&t, tree->buffer, tree->size); - if (unpack_trees(1, &t, &opts)) + return unpack_trees(1, &t, &opts); +} + +int run_diff_index(struct rev_info *revs, int cached) +{ + struct object_array_entry *ent; + + ent = revs->pending.objects; + if (diff_cache(revs, ent->item->sha1, ent->name, cached)) exit(128); diff_set_mnemonic_prefix(&revs->diffopt, "c/", cached ? "i/" : "w/");