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

[PATCH 2/2] remove blank filename in error message

From
PWPete Wyckoff <pw@padd.com>
Date
Apr 30, 2012, 00:28 UTC
Message-ID
<1335745726-2583-3-git-send-email-pw@padd.com>
In-Reply-To
<1335745726-2583-1-git-send-email-pw@padd.com>

When write_loose_object() finds that it is unable to create a temporary file, it complains, for instance:

    unable to create temporary sha1 filename : Too many open files

That extra space was supposed to be the name of the file, and will be an empty string if the git_mkstemps_mode() fails.

The name of the temporary file is unimportant; delete it.
Signed-off-by: Pete Wyckoff <pw@padd.com>
---
 sha1_file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sha1_file.c b/sha1_file.c
index c8d572d..3c4f165 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2511,7 +2511,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
 		if (errno == EACCES)
 			return error("insufficient permission for adding an object to repository database %s", get_object_directory());
 		else
-			return error("unable to create temporary sha1 filename %s: %s", tmp_file, strerror(errno));
+			return error("unable to create temporary file: %s", strerror(errno));
 	}
 
 	/* Set it up */
-- 
1.7.10.572.ged86f
Previous: Pete Wyckoff
Message 3 of 3 in “minor error message newline purge”
  1. 0/2 minor error message newline purgePete Wyckoff, Apr 30, 2012
  2. 1/2 remove superfluous newlines in error messagesPete Wyckoff, Apr 30, 2012
  3. 2/2 remove blank filename in error messagePete Wyckoff, Apr 30, 2012

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.