read-tree -u one-way merge fix to check out locally modified paths.
[gitweb.git] / read-tree.c
index e926e4c880363469c5abf766127acc466fb5e438..59b6a6bff9bc0b2dc7c922bf8e8b16cf36573fc7 100644 (file)
@@ -684,8 +684,11 @@ static int oneway_merge(struct cache_entry **src)
                             merge_size);
 
        if (!a)
-               return 0;
+               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);
                return keep_entry(old);
        }
        return merged_entry(a, NULL);