From 5a092ceb6b285e8377add13d460850668fd0d13c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 13 Jun 2014 19:19:48 +0700 Subject: [PATCH] read-tree: note about dropping split-index mode or index version MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/read-tree.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 3204c62eaf..e7e1c33a7f 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -155,6 +155,15 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) if (1 < opts.merge + opts.reset + prefix_set) die("Which one? -m, --reset, or --prefix?"); + /* + * NEEDSWORK + * + * The old index should be read anyway even if we're going to + * destroy all index entries because we still need to preserve + * certain information such as index version or split-index + * mode. + */ + if (opts.reset || opts.merge || opts.prefix) { if (read_cache_unmerged() && (opts.prefix || opts.merge)) die("You need to resolve your current index first"); -- 2.11.4.GIT