diff options
author | Junio C Hamano <junkio@cox.net> | 2005-04-17 10:02:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-17 10:02:21 -0700 |
commit | a38800fde24a44b12a9ed14852339466de1cb9c9 (patch) | |
tree | 3698891b68fda449e3ba7fe859a5b65d54e60c79 /checkout-cache.c | |
parent | fa06d442c6c5113fcff9991f349157bdb0c4b989 (diff) | |
download | git-a38800fde24a44b12a9ed14852339466de1cb9c9.tar.gz git-a38800fde24a44b12a9ed14852339466de1cb9c9.tar.xz |
[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: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'checkout-cache.c')
-rw-r--r-- | checkout-cache.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/checkout-cache.c b/checkout-cache.c index b909f5d9a..1c257666e 100644 --- a/checkout-cache.c +++ b/checkout-cache.c @@ -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]); |