Merge branch 'lt/oneway' into next
authorJunio C Hamano <junkio@cox.net>
Mon, 15 May 2006 20:51:07 +0000 (13:51 -0700)
committerJunio C Hamano <junkio@cox.net>
Mon, 15 May 2006 20:51:07 +0000 (13:51 -0700)
* lt/oneway:
  read-tree --reset -u fix.

1  2 
read-tree.c

diff --cc read-tree.c
@@@ -718,14 -688,15 +723,17 @@@ static int oneway_merge(struct cache_en
                return error("Cannot do a oneway merge of %d trees",
                             merge_size);
  
 -      if (!a)
 +      if (!a) {
 +              invalidate_ce_path(old);
                return deleted_entry(old, NULL);
 +      }
        if (old && same(old, a)) {
-               struct stat st;
-               if (lstat(old->name, &st) || ce_match_stat(old, &st, 1))
-                       old->ce_flags |= htons(CE_UPDATE);
+               if (reset) {
+                       struct stat st;
+                       if (lstat(old->name, &st) ||
+                           ce_match_stat(old, &st, 1))
+                               old->ce_flags |= htons(CE_UPDATE);
+               }
                return keep_entry(old);
        }
        return merged_entry(a, NULL);