summaryrefslogtreecommitdiff
path: root/builtin/update-index.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2016-01-24 15:28:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-25 20:39:22 (GMT)
commiteaab83d0e574c9f3440a2364a7975f9ffe75f188 (patch)
tree70a71dac844d56516c0a6f3a58c4f9298db38572 /builtin/update-index.c
parent113e6413187c65a9fbf2b845a1fb31c7d17c0755 (diff)
downloadgit-eaab83d0e574c9f3440a2364a7975f9ffe75f188.zip
git-eaab83d0e574c9f3440a2364a7975f9ffe75f188.tar.gz
git-eaab83d0e574c9f3440a2364a7975f9ffe75f188.tar.bz2
update-index: add --test-untracked-cache
It is nice to just be able to test if untracked cache is supported without enabling it. Helped-by: David Turner <dturner@twopensource.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r--builtin/update-index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 1e546a3..62222dd 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -40,6 +40,7 @@ enum uc_mode {
UC_UNSPECIFIED = -1,
UC_DISABLE = 0,
UC_ENABLE,
+ UC_TEST,
UC_FORCE
};
@@ -1004,6 +1005,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
N_("enable or disable split index")),
OPT_BOOL(0, "untracked-cache", &untracked_cache,
N_("enable/disable untracked cache")),
+ OPT_SET_INT(0, "test-untracked-cache", &untracked_cache,
+ N_("test if the filesystem supports untracked cache"), UC_TEST),
OPT_SET_INT(0, "force-untracked-cache", &untracked_cache,
N_("enable untracked cache without testing the filesystem"), UC_FORCE),
OPT_END()
@@ -1119,6 +1122,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
setup_work_tree();
if (!test_if_untracked_cache_is_supported())
return 1;
+ if (untracked_cache == UC_TEST)
+ return 0;
}
if (!the_index.untracked) {
uc = xcalloc(1, sizeof(*uc));