summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-31 19:08:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-31 19:08:48 (GMT)
commitefd02e92c9961063bae63da7f7446868a38f14ce (patch)
tree33bfacf99973b81ffb535185215d6346121460e3 /builtin
parent2951df7a9afd1dc17bbca62af4bde340e1d9368f (diff)
parentea5070c91f23e41a88dec48d2f8d96444c2d647a (diff)
downloadgit-efd02e92c9961063bae63da7f7446868a38f14ce.zip
git-efd02e92c9961063bae63da7f7446868a38f14ce.tar.gz
git-efd02e92c9961063bae63da7f7446868a38f14ce.tar.bz2
Merge branch 'jl/read-tree-m-dry-run'
* jl/read-tree-m-dry-run: Teach read-tree the -n|--dry-run option unpack-trees: add the dry_run flag to unpack_trees_options
Diffstat (limited to 'builtin')
-rw-r--r--builtin/read-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 93c9281..df6c4c8 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 */
/*