rev-list: fix --pretty=oneline with empty message
[gitweb.git] / builtin-read-tree.c
index 0c1f40d10d1846bb187f691ad16d6ed24cc7aa8d..8bdcab11389e8b4facab355f27f0e1926134b86f 100644 (file)
@@ -13,6 +13,7 @@
 #include "dir.h"
 #include "builtin.h"
 #include "parse-options.h"
+#include "resolve-undo.h"
 
 static int nr_trees;
 static struct tree *trees[MAX_UNPACK_TREES];
@@ -31,7 +32,7 @@ static int list_tree(unsigned char *sha1)
 }
 
 static const char * const read_tree_usage[] = {
-       "git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]]  [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]]",
+       "git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--no-sparse-checkout] [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]]",
        NULL
 };
 
@@ -126,6 +127,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                  PARSE_OPT_NONEG, exclude_per_directory_cb },
                OPT_SET_INT('i', NULL, &opts.index_only,
                            "don't check the working tree after merging", 1),
+               OPT_SET_INT(0, "no-sparse-checkout", &opts.skip_sparse_checkout,
+                           "skip applying sparse checkout filter", 1),
                OPT_SET_INT(0, "debug-unpack", &opts.debug_unpack,
                            "debug unpack-trees", 1),
                OPT_END()
@@ -152,6 +155,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                        die("You need to resolve your current index first");
                stage = opts.merge = 1;
        }
+       resolve_undo_clear();
 
        for (i = 0; i < argc; i++) {
                const char *arg = argv[i];