From: Junio C Hamano Date: Wed, 5 Oct 2011 19:35:53 +0000 (-0700) Subject: Merge branch 'jc/diff-index-unpack' X-Git-Tag: v1.7.8-rc0~155 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1b840a56629c8c0620c261672cc5d4d35ba253fa;p=git.git Merge branch 'jc/diff-index-unpack' * 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 --- 1b840a56629c8c0620c261672cc5d4d35ba253fa 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/");