summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unpack-trees.c4
-rw-r--r--unpack-trees.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 0bc4b2ddca..07f8364244 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -203,7 +203,7 @@ static int check_updates(struct unpack_trees_options *o)
if (ce->ce_flags & CE_WT_REMOVE) {
display_progress(progress, ++cnt);
- if (o->update)
+ if (o->update && !o->dry_run)
unlink_entry(ce);
continue;
}
@@ -217,7 +217,7 @@ static int check_updates(struct unpack_trees_options *o)
if (ce->ce_flags & CE_UPDATE) {
display_progress(progress, ++cnt);
ce->ce_flags &= ~CE_UPDATE;
- if (o->update) {
+ if (o->update && !o->dry_run) {
errs |= checkout_entry(ce, &state, NULL);
}
}
diff --git a/unpack-trees.h b/unpack-trees.h
index cd11a08365..64f02cb03a 100644
--- a/unpack-trees.h
+++ b/unpack-trees.h
@@ -46,7 +46,8 @@ struct unpack_trees_options {
debug_unpack,
skip_sparse_checkout,
gently,
- show_all_errors;
+ show_all_errors,
+ dry_run;
const char *prefix;
int cache_bottom;
struct dir_struct *dir;