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

[PATCH] Solaris 5.8 returns ENOTDIR for inappropriate renames.

From
Jason Riedy <ejr@eecs.berkeley.edu>
Date
Jan 16, 2007, 01:30 UTC
Message-ID
<17433.1168911059@lotus.CS.Berkeley.EDU>

The reflog code clears empty directories when rename returns either EISDIR or ENOTDIR. Seems to be the only place.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
---
   Haven't been keeping up with the list, so I apologize if I've
   missed discussions related to these changes.
 refs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/refs.c b/refs.c
index 689ac50..851b573 100644
--- a/refs.c
+++ b/refs.c
@@ -837,7 +837,7 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
 
  retry:
 	if (log && rename(git_path("tmp-renamed-log"), git_path("logs/%s", newref))) {
-		if (errno==EISDIR) {
+		if (errno==EISDIR || errno==ENOTDIR) {
 			if (remove_empty_directories(git_path("logs/%s", newref))) {
 				error("Directory not empty: logs/%s", newref);
 				goto rollback;
-- 
1.5.0.rc1.gf4b6c
Next: Junio C Hamano
Message 1 of 2 in “Solaris 5.8 returns ENOTDIR for inappropriate renames.”
  1. Solaris 5.8 returns ENOTDIR for inappropriate renames.Jason Riedy, Jan 16, 2007
  2. Junio C HamanoJan 16, 2007

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.