init: don't set core.worktree when initializing /.git
[gitweb.git] / unpack-trees.c
index 164354dad7cbbaa7100f73256807680a75188021..02f69aeea3dc2e60336fa4ac018ec14ae10f911e 100644 (file)
@@ -102,18 +102,17 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
                opts->unpack_rejects[i].strdup_strings = 1;
 }
 
-static void do_add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
+static int do_add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
                         unsigned int set, unsigned int clear)
 {
-       clear |= CE_HASHED | CE_UNHASHED;
+       clear |= CE_HASHED;
 
        if (set & CE_REMOVE)
                set |= CE_WT_REMOVE;
 
-       ce->next = NULL;
        ce->ce_flags = (ce->ce_flags & ~clear) | set;
-       add_index_entry(&o->result, ce,
-                       ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
+       return add_index_entry(&o->result, ce,
+                              ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
 }
 
 static struct cache_entry *dup_entry(const struct cache_entry *ce)
@@ -204,7 +203,7 @@ static int check_updates(struct unpack_trees_options *o)
                                total++;
                }
 
-               progress = start_progress_delay("Checking out files",
+               progress = start_progress_delay(_("Checking out files"),
                                                total, 50, 1);
                cnt = 0;
        }
@@ -608,7 +607,9 @@ static int unpack_nondirectories(int n, unsigned long mask,
 
        for (i = 0; i < n; i++)
                if (src[i] && src[i] != o->df_conflict_entry)
-                       do_add_entry(o, src[i], 0, 0);
+                       if (do_add_entry(o, src[i], 0, 0))
+                               return -1;
+
        return 0;
 }