Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Solaris 5.8 returns ENOTDIR for inappropriate renames.
author
Jason Riedy
<ejr@EECS.Berkeley.EDU>
Tue, 16 Jan 2007 01:30:59 +0000
(17:30 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 16 Jan 2007 06:27:05 +0000
(22:27 -0800)
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>
refs.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
2aad957
)
diff --git
a/refs.c
b/refs.c
index 689ac50bae64a1068f2d9b1d720817748fc2289d..7d858637c438f3938af3cf7a8d592cef1fa3bd43 100644
(file)
--- 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;