summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa06d44)
raw | patch | inline | side by side (parent: fa06d44)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 17 Apr 2005 17:02:21 +0000 (10:02 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 17 Apr 2005 17:02:21 +0000 (10:02 -0700) |
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: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
checkout-cache.c | patch | blob | history |
diff --git a/checkout-cache.c b/checkout-cache.c
index b909f5d9a0ec10c99b850bf794cb7a4191cd0740..1c257666e641868ff8a12a4e96a03a1d787c84a6 100644 (file)
--- a/checkout-cache.c
+++ b/checkout-cache.c
{
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]);