{"thread":{"id":"80","subject":"[PATCH] Better error message from checkout-cache for unmerged files.","startedAt":"2005-04-17T09:00:44Z","lastAt":"2005-04-17T09:00:44Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"460","messageId":"7vvf6lzsjn.fsf@assigned-by-dhcp.cox.net","threadId":"80","inReplyTo":null,"subject":"[PATCH] Better error message from checkout-cache for unmerged files.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-17T09:00:44Z","receivedAt":"2005-04-17T09:00:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The checkout-cache command says \"file is not in the cache\" when\nan unmerged path is given.  This patch adds code to distinguish\nthe unmerged and the nonexistent cases and gives an appropriate\nerror message.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n checkout-cache.c |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ncheckout-cache.c: e16619c9d099367c224fb485f5525d66267bbd92\n--- checkout-cache.c\n+++ checkout-cache.c\t2005-04-17 01:49:01.000000000 -0700\n@@ -121,8 +121,15 @@\n {\n \tint pos = cache_name_pos(name, strlen(name));\n \tif (pos < 0) {\n-\t\tif (!quiet)\n-\t\t\tfprintf(stderr, \"checkout-cache: %s is not in the cache\\n\", name);\n+\t\tif (!quiet) {\n+\t\t\tpos = -pos - 1;\n+\t\t\tfprintf(stderr,\n+\t\t\t\t\"checkout-cache: %s is %s.\\n\",\n+\t\t\t\tname,\n+\t\t\t\t(pos < active_nr &&\n+\t\t\t\t !strcmp(active_cache[pos]->name, name)) ?\n+\t\t\t\t\"unmerged\" : \"not in the cache\");\n+\t\t}\n \t\treturn -1;\n \t}\n \treturn checkout_entry(active_cache[pos]);\n\n"}]}