Merge branch 'jc/diff-index-unpack'
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2011 19:35:53 +0000 (12:35 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2011 19:35:53 +0000 (12:35 -0700)
* 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

1  2 
diff-lib.c
unpack-trees.c
unpack-trees.h

diff --cc diff-lib.c
index f8454dd2918dc74bee43d9f2faa1837cc5665abd,12760b422f83e0c08d4ad9af5419318e9d47bcaa..ebe751e72d0ca9db2f0a9d2576f3dc3f41ffc31d
@@@ -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/");
diff --cc unpack-trees.c
Simple merge
diff --cc unpack-trees.h
Simple merge