[PATCH] Take it easy on unallowed access to non-existent repository

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?=
Date: Sunday, April 11, 2010 - 4:01 am

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 2010/4/9 Jeff King <peff@peff.net>:
 > Yeah, that sounds reasonable, especially if merging this to 'next' would
 > make git unusable. We want to shake out bugs, not punish people running
 > next. :) But I haven't even really looked at the topic in detail yet.

 This patch could be squashed into 551a5786 (Guard unallowed access to repository..)
 Still don't know what to do with "git ls-remote". I'm not familiar with it.

 config.c      |    2 +-
 environment.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config.c b/config.c
index 9981b09..63702bf 100644
--- a/config.c
+++ b/config.c
@@ -738,7 +738,7 @@ int git_config(config_fn_t fn, void *data)
 	int ret;
 
 	if (startup_info && !startup_info->have_run_setup_gitdir)
-		die("internal error: access to .git/config without repo setup");
+		warning("Broken repository setup: early access to $GIT_DIR/config");
 	if (!startup_info || startup_info->have_repository)
 		repo_config = git_pathdup("config");
 	ret = git_config_early(fn, data, repo_config);
diff --git a/environment.c b/environment.c
index 28624ad..dbaed04 100644
--- a/environment.c
+++ b/environment.c
@@ -99,7 +99,7 @@ void unset_git_env(void)
 static void setup_git_env(void)
 {
 	if (startup_info && startup_info->have_run_setup_gitdir)
-		die("internal error: setup_git_env can't be called twice");
+		warning("Broken repository setup: setup_git_env() called twice");
 	git_dir = getenv(GIT_DIR_ENVIRONMENT);
 	if (!git_dir) {
 		/*
@@ -107,7 +107,7 @@ static void setup_git_env(void)
 		 * or enter_repo, not by this function
 		 */
 		if (startup_info)
-			die("internal error: $GIT_DIR is empty");
+			warning("Broken respository setup: git_dir is empty");
 		git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
 	}
 	if (!git_dir)
-- 
1.7.0.rc1.541.g2da82.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
What's cooking in git.git (Apr 2010, #03; Wed, 07), Junio C Hamano, (Wed Apr 7, 5:48 pm)
Re: What's cooking in git.git (Apr 2010, #03; Wed, 07), Johannes Sixt, (Wed Apr 7, 11:05 pm)
Re: What's cooking in git.git (Apr 2010, #03; Wed, 07), Junio C Hamano, (Wed Apr 7, 11:33 pm)
Re: What's cooking in git.git (Apr 2010, #03; Wed, 07), Fredrik Kuivinen, (Thu Apr 8, 2:01 am)
nd/setup, Jonathan Nieder, (Thu Apr 8, 2:42 pm)
Re: nd/setup, Jeff King, (Thu Apr 8, 5:13 pm)
Re: nd/setup, Nguyen Thai Ngoc Duy, (Thu Apr 8, 10:46 pm)
Re: nd/setup, Jonathan Nieder, (Thu Apr 8, 10:57 pm)
Re: nd/setup, Nguyen Thai Ngoc Duy, (Thu Apr 8, 11:56 pm)
[PATCH] Take it easy on unallowed access to non-existent r ..., =?UTF-8?q?Nguy=E1=BB ..., (Sun Apr 11, 4:01 am)
Re: [PATCH] Take it easy on unallowed access to non-existe ..., Nguyen Thai Ngoc Duy, (Sun Apr 11, 10:49 am)
Re: [PATCH] Take it easy on unallowed access to non-existe ..., Sverre Rabbelier, (Sun Apr 11, 10:52 am)
Re: nd/setup, Nguyen Thai Ngoc Duy, (Sun Apr 11, 10:57 am)
Re: [PATCH] Take it easy on unallowed access to non-existe ..., Nguyen Thai Ngoc Duy, (Sun Apr 11, 10:57 am)