summaryrefslogtreecommitdiff
path: root/builtin/read-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/read-tree.c')
-rw-r--r--builtin/read-tree.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 73cb957a69..443d206eca 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -201,11 +201,9 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
if ((opts.update || opts.index_only) && !opts.merge)
die("%s is meaningless without -m, --reset, or --prefix",
opts.update ? "-u" : "-i");
- if (opts.update && !opts.reset) {
- CALLOC_ARRAY(opts.dir, 1);
- opts.dir->flags |= DIR_SHOW_IGNORED;
- setup_standard_excludes(opts.dir);
- }
+ if (opts.update && !opts.reset)
+ opts.preserve_ignored = 0;
+ /* otherwise, opts.preserve_ignored is irrelevant */
if (opts.merge && !opts.index_only)
setup_work_tree();
@@ -245,11 +243,6 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
if (unpack_trees(nr_trees, t, &opts))
return 128;
- if (opts.dir) {
- dir_clear(opts.dir);
- FREE_AND_NULL(opts.dir);
- }
-
if (opts.debug_unpack || opts.dry_run)
return 0; /* do not write the index out */