[PATCH] Solaris 5.8 returns ENOTDIR for inappropriate renames.
From: Jason Riedy <hidden>
Date: 2016-06-15 22:42:49
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Jason Riedy <hidden>
Date: 2016-06-15 22:42:49
Subsystem:
the rest · Maintainer:
Linus Torvalds
The reflog code clears empty directories when rename returns either EISDIR or ENOTDIR. Seems to be the only place. Signed-off-by: Jason Riedy <redacted> --- 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