From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Schrab Subject: [PATCH 1/2] clone: Fix error message for reference repository Date: Mon, 8 Apr 2013 18:46:39 -0400 Message-ID: <1365461200-13509-2-git-send-email-aaron@schrab.com> References: <20130408185957.GM27178@pug.qqx.org> <1365461200-13509-1-git-send-email-aaron@schrab.com> Cc: gitster@pobox.com, jrnieder@gmail.com To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Apr 09 00:47:13 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UPKqF-0007QA-VU for gcvg-git-2@plane.gmane.org; Tue, 09 Apr 2013 00:47:12 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936413Ab3DHWrF (ORCPT ); Mon, 8 Apr 2013 18:47:05 -0400 Received: from pug.qqx.org ([50.116.43.67]:36535 "EHLO pug.qqx.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935227Ab3DHWrE (ORCPT ); Mon, 8 Apr 2013 18:47:04 -0400 Received: from zim.qqx.org (cpe-107-015-024-243.nc.res.rr.com [107.15.24.243]) by pug.qqx.org (Postfix) with ESMTPSA id 120BD57E06 for ; Mon, 8 Apr 2013 18:47:03 -0400 (EDT) Received: from ats (uid 1000) (envelope-from aaron@schrab.com) id 4032b by zim.qqx.org (DragonFly Mail Agent); Mon, 08 Apr 2013 18:47:02 -0400 X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365461200-13509-1-git-send-email-aaron@schrab.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Do not report that an argument to clone's --reference option is not a local directory. Nothing checks for the existence or type of the path as supplied by the user; checks are only done for particular contents of the supposed directory, so we have no way to know the status of the supplied path. Telling the user that a directory doesn't exist when that isn't actually known may lead him or her on the wrong path to finding the problem. Instead just state that the entered path is not a local repository which is really all that is known about it. It could be more helpful to state the actual paths which were checked, but I believe that giving a good description of that would be too verbose for a simple error message and would be too dependent on implementation details. Signed-off-by: Aaron Schrab --- builtin/clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/clone.c b/builtin/clone.c index f9c380e..0a1e0bf 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -241,7 +241,7 @@ static int add_one_reference(struct string_list_item *item, void *cb_data) free(ref_git); ref_git = ref_git_git; } else if (!is_directory(mkpath("%s/objects", ref_git))) - die(_("reference repository '%s' is not a local directory."), + die(_("reference repository '%s' is not a local repository."), item->string); strbuf_addf(&alternate, "%s/objects", ref_git); -- 1.7.10.4