Git development
 help / color / mirror / Atom feed
* [PATCH] Better error message from checkout-cache for unmerged files.
@ 2005-04-17  9:00 Junio C Hamano
  0 siblings, 0 replies; only message in thread
From: Junio C Hamano @ 2005-04-17  9:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

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>
---

 checkout-cache.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

checkout-cache.c: e16619c9d099367c224fb485f5525d66267bbd92
--- checkout-cache.c
+++ checkout-cache.c	2005-04-17 01:49:01.000000000 -0700
@@ -121,8 +121,15 @@
 {
 	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]);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-17  8:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-17  9:00 [PATCH] Better error message from checkout-cache for unmerged files Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox