read-tree: setup worktree if merge is required
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 28 Aug 2008 13:03:22 +0000 (20:03 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Aug 2008 05:47:17 +0000 (22:47 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-read-tree.c

index 72a6de302f88728af17ce5c5c6983c5267afc6f6..dddc3044b8e42d3083f1f6db0d9c205f01e14141 100644 (file)
@@ -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)