git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Apr 11, 2010, 11:01 UTC
Message-ID
<1270983682-12215-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<20100409001322.GB23501@coredump.intra.peff.net>
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
Previous: Jeff KingNext: Sverre Rabbelier
Message 10 of 18 in “What's cooking in git.git (Apr 2010, #03; Wed, 07)”
  1. Junio C HamanoApr 8, 2010
  2. Johannes SixtApr 8, 2010
  3. Junio C HamanoApr 8, 2010
  4. Fredrik KuivinenApr 8, 2010
  5. Tor ArntsenApr 8, 2010
  6. Tor ArntsenApr 8, 2010
  7. Jeff KingApr 8, 2010
  8. nd/setupJonathan Nieder, Apr 8, 2010
  9. Jeff KingApr 9, 2010
  10. Take it easy on unallowed access to non-existent repositoryNguyễn Thái Ngọc Duy, Apr 11, 2010
  11. Sverre RabbelierApr 11, 2010
  12. Nguyen Thai Ngoc DuyApr 11, 2010
  13. Sverre RabbelierApr 11, 2010
  14. Nguyen Thai Ngoc DuyApr 11, 2010
  15. Nguyen Thai Ngoc DuyApr 9, 2010
  16. Jonathan NiederApr 9, 2010
  17. Nguyen Thai Ngoc DuyApr 9, 2010
  18. Nguyen Thai Ngoc DuyApr 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.