OSDN Git Service

Merge branch 'jc/cache-tree'
authorJunio C Hamano <gitster@pobox.com>
Sun, 21 Jun 2009 04:47:30 +0000 (21:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Jun 2009 04:47:30 +0000 (21:47 -0700)
* jc/cache-tree:
  Avoid "diff-index --cached" optimization under --find-copies-harder
  Optimize "diff-index --cached" using cache-tree
  t4007: modernize the style
  cache-tree.c::cache_tree_find(): simplify internal API
  write-tree --ignore-cache-tree

1  2 
diff-lib.c

diff --combined diff-lib.c
@@@ -214,7 -214,7 +214,7 @@@ static int get_stat_data(struct cache_e
        const unsigned char *sha1 = ce->sha1;
        unsigned int mode = ce->ce_mode;
  
 -      if (!cached) {
 +      if (!cached && !ce_uptodate(ce)) {
                int changed;
                struct stat st;
                changed = check_removed(ce, &st);
@@@ -446,6 -446,8 +446,8 @@@ int run_diff_index(struct rev_info *rev
        memset(&opts, 0, sizeof(opts));
        opts.head_idx = 1;
        opts.index_only = cached;
+       opts.diff_index_cached = (cached &&
+                                 !DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER));
        opts.merge = 1;
        opts.fn = oneway_diff;
        opts.unpack_data = revs;
@@@ -502,6 -504,7 +504,7 @@@ int do_diff_cache(const unsigned char *
        memset(&opts, 0, sizeof(opts));
        opts.head_idx = 1;
        opts.index_only = 1;
+       opts.diff_index_cached = !DIFF_OPT_TST(opt, FIND_COPIES_HARDER);
        opts.merge = 1;
        opts.fn = oneway_diff;
        opts.unpack_data = &revs;