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

[PATCH 1/4] git-init-db should error out with a message

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 25, 2005, 23:39 UTC
Message-ID
<Pine.LNX.4.63.0510260139000.30576@wbgn013.biozentrum.uni-wuerzburg.de>

When the HEAD symref could not be created, it is helpful for the user to know that.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 init-db.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applies-to: 51f96562f1ef47cd9a09731e3f27445efaddbbe7 159c632ef3cc7371aaa495c41afd5fd41e2d3f3f

diff --git a/init-db.c b/init-db.c
index aabc09f..2c27e18 100644
--- a/init-db.c
+++ b/init-db.c
@@ -192,7 +192,7 @@ static void create_default_files(const c
 	strcpy(path + len, "HEAD");
 	if (read_ref(path, sha1) < 0) {
 		if (create_symref(path, "refs/heads/master") < 0)
-			exit(1);
+			die("Could not create HEAD symref!");
 	}
 	path[len] = 0;
 	copy_templates(path, len, template_path);
---
0.99.8.GIT
Next: Alex Riesen
Message 1 of 5 in “git-init-db should error out with a message”
  1. 1/4 git-init-db should error out with a messageJohannes Schindelin, Oct 25, 2005
  2. Alex RiesenOct 26, 2005
  3. Junio C HamanoOct 26, 2005
  4. Alex RiesenOct 26, 2005
  5. Junio C HamanoOct 26, 2005

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.