提交 a38800fd 编写于 作者: J Junio C Hamano 提交者: Linus Torvalds

[PATCH] Better error message from checkout-cache for unmerged files.

The checkout-cache command says "file is not in the cache" when
an unmerged path is given.  This patch adds code to distinguish
the unmerged and the nonexistent cases and gives an appropriate
error message.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 fa06d442
......@@ -121,8 +121,15 @@ static int checkout_file(const char *name)
{
int pos = cache_name_pos(name, strlen(name));
if (pos < 0) {
if (!quiet)
fprintf(stderr, "checkout-cache: %s is not in the cache\n", name);
if (!quiet) {
pos = -pos - 1;
fprintf(stderr,
"checkout-cache: %s is %s.\n",
name,
(pos < active_nr &&
!strcmp(active_cache[pos]->name, name)) ?
"unmerged" : "not in the cache");
}
return -1;
}
return checkout_entry(active_cache[pos]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册