summaryrefslogtreecommitdiffstats
path: root/unpack-trees.h
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2011-05-25 22:07:51 +0200
committerJunio C Hamano <gitster@pobox.com>2011-05-25 14:32:02 -0700
commit2c9078d05bf2200c9671e0b292638d42e7e4fd71 (patch)
treec873748e61b11a5fe79c97af317f0ae39f3d9559 /unpack-trees.h
parent5df3e2b3ca5ebe8123927a81d682993ad597a584 (diff)
downloadgit-2c9078d05bf2200c9671e0b292638d42e7e4fd71.tar.gz
git-2c9078d05bf2200c9671e0b292638d42e7e4fd71.tar.xz
unpack-trees: add the dry_run flag to unpack_trees_options
Until now there was no way to test if unpack_trees() with update=1 would succeed without really updating the work tree. The reason for that is that setting update to 0 does skip the tests for new files and deactivates the sparse handling, thereby making that unsuitable as a dry run. Add the new dry_run flag to struct unpack_trees_options unpack_trees(). Setting that together with the update flag will check if the work tree update would be successful without doing it for real. The only class of problems that is not detected at the moment are file system conditions like ENOSPC or missing permissions. Also the index entries of updated files are not as they would be after a real checkout because lstat() isn't run as the files aren't updated for real. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.h')
-rw-r--r--unpack-trees.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/unpack-trees.h b/unpack-trees.h
index cd11a0836..64f02cb03 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;