summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-09-22 21:24:23 +1000
committerJunio C Hamano <gitster@pobox.com>2011-09-22 11:35:48 -0700
commita7bc906f2e64f0d9d3fec91964dc38e390ef69a1 (patch)
treeea71f938418eb3a972a5282e0f91585c68315d99 /unpack-trees.c
parent17d26a4d0485229c24b649013a40d5928ba223cc (diff)
downloadgit-a7bc906f2e64f0d9d3fec91964dc38e390ef69a1.tar.gz
Add explanation why we do not allow to sparse checkout to empty working treend/maint-sparse-errors
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 8d4fbaa4ad..0f205903e1 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1119,8 +1119,13 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
}
if (ret < 0)
goto return_failed;
+ /*
+ * Sparse checkout is meant to narrow down checkout area
+ * but it does not make sense to narrow down to empty working
+ * tree. This is usually a mistake in sparse checkout rules.
+ * Do not allow users to do that.
+ */
if (o->result.cache_nr && empty_worktree) {
- /* dubious---why should this fail??? */
ret = unpack_failed(o, "Sparse checkout leaves no entry on working directory");
goto done;
}