Code

rev-list: move code to show bisect vars into its own function
[git.git] / builtin-read-tree.c
index 72a6de302f88728af17ce5c5c6983c5267afc6f6..8e0273864d6af8de2a31868dcfbeda29cd36c2fc 100644 (file)
@@ -64,7 +64,7 @@ static void prime_cache_tree(void)
 
 }
 
-static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <sha1> [<sha2> [<sha3>]])";
+static const char read_tree_usage[] = "git read-tree (<sha> | [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <sha1> [<sha2> [<sha3>]])";
 
 static struct lock_file lock_file;
 
@@ -170,7 +170,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                                die("more than one --exclude-per-directory are given.");
 
                        dir = xcalloc(1, sizeof(*opts.dir));
-                       dir->show_ignored = 1;
+                       dir->flags |= DIR_SHOW_IGNORED;
                        dir->exclude_per_dir = arg + 24;
                        opts.dir = dir;
                        /* We do not need to nor want to do read-directory
@@ -194,6 +194,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                usage(read_tree_usage);
        if ((opts.dir && !opts.update))
                die("--exclude-per-directory is meaningless unless -u");
+       if (opts.merge && !opts.index_only)
+               setup_work_tree();
 
        if (opts.merge) {
                if (stage < 2)
@@ -204,6 +206,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                        break;
                case 2:
                        opts.fn = twoway_merge;
+                       opts.initial_checkout = is_cache_unborn();
                        break;
                case 3:
                default: