diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-31 12:08:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-31 12:08:48 -0700 |
commit | efd02e92c9961063bae63da7f7446868a38f14ce (patch) | |
tree | 33bfacf99973b81ffb535185215d6346121460e3 /builtin | |
parent | 2951df7a9afd1dc17bbca62af4bde340e1d9368f (diff) | |
parent | ea5070c91f23e41a88dec48d2f8d96444c2d647a (diff) | |
download | git-efd02e92c9961063bae63da7f7446868a38f14ce.tar.gz |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 93c92814cf..df6c4c8819 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 */ /* |