X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fread-tree.c;h=df6c4c8819e7903f34cd6dc6bb0078a6cddac310;hb=1f2705e20fa5f2d3c93663296eef723f45d1fa41;hp=93c92814cf28855aee87cabf4a3b906e11a36125;hpb=06ff44951a233c2e3dee4f072430ac68306f9bf0;p=git.git diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 93c92814c..df6c4c881 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -130,6 +130,7 @@ 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__DRY_RUN(&opts.dry_run, "don't update the index or the work tree"), 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, @@ -219,7 +220,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) if (unpack_trees(nr_trees, t, &opts)) return 128; - if (opts.debug_unpack) + if (opts.debug_unpack || opts.dry_run) return 0; /* do not write the index out */ /*