From: Nguyễn Thái Ngọc Duy Date: Thu, 22 Sep 2011 11:24:23 +0000 (+1000) Subject: Add explanation why we do not allow to sparse checkout to empty working tree X-Git-Tag: v1.7.8-rc0~90^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a7bc906f2e64f0d9d3fec91964dc38e390ef69a1;p=git.git Add explanation why we do not allow to sparse checkout to empty working tree Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/unpack-trees.c b/unpack-trees.c index 8d4fbaa4a..0f205903e 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; }