aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJason Riedy <ejr@EECS.Berkeley.EDU>2007-01-15 17:30:59 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-15 22:27:05 -0800
commitd9e74d5745127a5d483788c264fe0d4332868d67 (patch)
treea01f3248ea59cb72e973ceb881f47d15eaede9f7 /refs.c
parent2aad957a519b354e248da8c76ee0d3997083dde6 (diff)
downloadgit-d9e74d5745127a5d483788c264fe0d4332868d67.tar.gz
git-d9e74d5745127a5d483788c264fe0d4332868d67.tar.xz
Solaris 5.8 returns ENOTDIR for inappropriate renames.
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> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 689ac50ba..7d858637c 100644
--- a/refs.c
+++ b/refs.c
@@ -837,7 +837,12 @@ 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) {
+ /*
+ * rename(a, b) when b is an existing
+ * directory ought to result in ISDIR, but
+ * Solaris 5.8 gives ENOTDIR. Sheesh.
+ */
if (remove_empty_directories(git_path("logs/%s", newref))) {
error("Directory not empty: logs/%s", newref);
goto rollback;